mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Fix iterator invalidation problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9272 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -144,8 +144,8 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
ResolverArgs.push_back(GEP);
|
ResolverArgs.push_back(GEP);
|
||||||
|
|
||||||
// Insert code at the beginning of the function
|
// Insert code at the beginning of the function
|
||||||
for (Value::use_iterator i=F->use_begin(), e=F->use_end(); i!=e; ++i) {
|
while (!F->use_empty())
|
||||||
if (Instruction* Inst = dyn_cast<Instruction>(*i)) {
|
if (Instruction *Inst = dyn_cast<Instruction>(F->use_back())) {
|
||||||
// call resolver(GetElementPtr...)
|
// call resolver(GetElementPtr...)
|
||||||
CallInst *resolve = new CallInst(resolverFunc, ResolverArgs,
|
CallInst *resolve = new CallInst(resolverFunc, ResolverArgs,
|
||||||
"resolver", Inst);
|
"resolver", Inst);
|
||||||
@ -164,7 +164,6 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (verifyModule(*SafeModule) || verifyModule(*TestModule)) {
|
if (verifyModule(*SafeModule) || verifyModule(*TestModule)) {
|
||||||
std::cerr << "Bugpoint has a bug, an corrupted a module!!\n";
|
std::cerr << "Bugpoint has a bug, an corrupted a module!!\n";
|
||||||
|
Reference in New Issue
Block a user