diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-01-21 20:43:02 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-01-21 20:43:02 +0000 |
commit | 53e6bb75cf670d33531f4658ef321b93a2bebb8b (patch) | |
tree | a1b8afc38ff34a259b85679cee26b857d3ff2685 | |
parent | 96d207d83caedd3cab14263073e089d0541b8c24 (diff) | |
download | llvm-53e6bb75cf670d33531f4658ef321b93a2bebb8b.tar.gz |
Merge from mainline.
Make sure the caller doesn't use freed memory.
Fixes PR1935.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_22@46213 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 8d6c923ab134..5c572a640ed0 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -401,8 +401,10 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){ } // If we removed all uses, nuke the cast. - if (CI->use_empty()) + if (CI->use_empty()) { CI->eraseFromParent(); + MadeChange = true; + } return MadeChange; } |