git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112081
91177308-0d34-0410-b5e6-
96231b3b80d8
if (A->getParent() == 0) {
// We found at least one unresolved value. Nuke them all to avoid leaks.
for (unsigned i = ModuleValueListSize, e = ValueList.size(); i != e; ++i){
- if ((A = dyn_cast<Argument>(ValueList.back())) && A->getParent() == 0) {
+ if ((A = dyn_cast<Argument>(ValueList[i])) && A->getParent() == 0) {
A->replaceAllUsesWith(UndefValue::get(A->getType()));
delete A;
}