From: Dan Gohman Date: Wed, 25 Aug 2010 20:20:21 +0000 (+0000) Subject: Fix a bug found by inspection. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=56e2a5774423047cd9b1a76e1e7b233567780ca6;p=oota-llvm.git Fix a bug found by inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112081 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 96b7f4d22dc..63c85974e45 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -2323,7 +2323,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { 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(ValueList.back())) && A->getParent() == 0) { + if ((A = dyn_cast(ValueList[i])) && A->getParent() == 0) { A->replaceAllUsesWith(UndefValue::get(A->getType())); delete A; }