From: Chris Lattner Date: Tue, 17 Jun 2003 03:57:18 +0000 (+0000) Subject: Don't corrupt memory when removing an instruction from the program, but X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bea68b3021ee9fea9ca28f8d14e742b025f95c2b;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index b467784b5e1..6883818dbc0 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;