aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-01-20 16:51:46 +0000
committerDuncan Sands <baldrick@free.fr>2008-01-20 16:51:46 +0000
commitad4e8138d16b24c1a7e4161deefa482dee1b238e (patch)
tree675141e107ce8e911f331989419352c0f7c6450d /lib/Transforms
parentab46ce6d2376c8b37af3bcd2f516f3ea95c7566c (diff)
downloadexternal_llvm-ad4e8138d16b24c1a7e4161deefa482dee1b238e.zip
external_llvm-ad4e8138d16b24c1a7e4161deefa482dee1b238e.tar.gz
external_llvm-ad4e8138d16b24c1a7e4161deefa482dee1b238e.tar.bz2
Make sure the caller doesn't use freed memory.
Fixes PR1935. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 8d6c923..5c572a6 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;
}