Author: tbrethou Date: Mon Jan 21 14:43:02 2008 New Revision: 46213 URL: http://llvm.org/viewvc/llvm-project?rev=46213&view=rev Log: Merge from mainline. Make sure the caller doesn't use freed memory. Fixes PR1935.
Modified: llvm/branches/release_22/lib/Transforms/Scalar/CodeGenPrepare.cpp Modified: llvm/branches/release_22/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=46213&r1=46212&r2=46213&view=diff ============================================================================== --- llvm/branches/release_22/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/branches/release_22/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon Jan 21 14:43:02 2008 @@ -401,8 +401,10 @@ } // If we removed all uses, nuke the cast. - if (CI->use_empty()) + if (CI->use_empty()) { CI->eraseFromParent(); + MadeChange = true; + } return MadeChange; } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits