forked from OSchip/llvm-project
[SCCP] Fix mem-sanitizer failure introduced by r315288.
llvm-svn: 315294
This commit is contained in:
parent
b5ca92ef73
commit
7d2375df30
|
@ -1600,8 +1600,10 @@ static bool tryToReplaceWithConstantRange(SCCPSolver &Solver, Value *V) {
|
|||
if (!(V->getType()->isIntegerTy() && IV.isConstantRange()))
|
||||
return false;
|
||||
|
||||
for (auto &Use : V->uses()) {
|
||||
auto *Icmp = dyn_cast<ICmpInst>(Use.getUser());
|
||||
for (auto UI = V->uses().begin(), E = V->uses().end(); UI != E;) {
|
||||
// Advance the iterator here, as we might remove the current use.
|
||||
const Use &U = *UI++;
|
||||
auto *Icmp = dyn_cast<ICmpInst>(U.getUser());
|
||||
if (!Icmp)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue