summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-17 03:57:18 +0000
committerChris Lattner <sabre@nondot.org>2003-06-17 03:57:18 +0000
commitbea68b3021ee9fea9ca28f8d14e742b025f95c2b (patch)
tree1fafb9b9cdda79762bfab99da251d8ab10834866 /lib
parenta9f6e4ae0eaea69949755807b7207177f256eace (diff)
downloadllvm-bea68b3021ee9fea9ca28f8d14e742b025f95c2b.tar.gz
llvm-bea68b3021ee9fea9ca28f8d14e742b025f95c2b.tar.bz2
llvm-bea68b3021ee9fea9ca28f8d14e742b025f95c2b.tar.xz
Don't corrupt memory when removing an instruction from the program, but
not the worklist git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/GCSE.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp
index b467784b5e..6883818dbc 100644
--- a/lib/Transforms/Scalar/GCSE.cpp
+++ b/lib/Transforms/Scalar/GCSE.cpp
@@ -120,6 +120,7 @@ bool GCSE::EliminateRedundancies(Instruction *I,
// Erase the instruction from the program.
I->getParent()->getInstList().erase(I);
+ WorkList.erase(I);
}
return true;