mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Potential bug in RewriteLoopBodyWithConditionConstant: use iterator should not be changed inside the uses enumeration loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fe2cb3e37f
commit
be4c844648
@ -907,9 +907,13 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
|
||||
Instruction *U = dyn_cast<Instruction>(*UI);
|
||||
if (!U || !L->contains(U))
|
||||
continue;
|
||||
U->replaceUsesOfWith(LIC, Replacement);
|
||||
Worklist.push_back(U);
|
||||
}
|
||||
|
||||
for (std::vector<Instruction*>::iterator UI = Worklist.begin();
|
||||
UI != Worklist.end(); ++UI)
|
||||
(*UI)->replaceUsesOfWith(LIC, Replacement);
|
||||
|
||||
SimplifyCode(Worklist, L);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user