llvm.org GIT mirror llvm / 56e2a57
Fix a bug found by inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112081 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
23222322 if (A->getParent() == 0) {
23232323 // We found at least one unresolved value. Nuke them all to avoid leaks.
23242324 for (unsigned i = ModuleValueListSize, e = ValueList.size(); i != e; ++i){
2325 if ((A = dyn_cast(ValueList.back())) && A->getParent() == 0) {
2325 if ((A = dyn_cast(ValueList[i])) && A->getParent() == 0) {
23262326 A->replaceAllUsesWith(UndefValue::get(A->getType()));
23272327 delete A;
23282328 }