summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-01 01:27:45 +0000
committerChris Lattner <sabre@nondot.org>2009-11-01 01:27:45 +0000
commitaa99c94e2a75e86381bcc45de61c11725a1484d6 (patch)
tree5ebc881e76d6c5d15bc2a8240caa9c274da1a3ce /llvm/lib/Bitcode/Reader
parent6f29ad917051349b99d566ddf57add7c60489094 (diff)
downloadbcm5719-llvm-aa99c94e2a75e86381bcc45de61c11725a1484d6.tar.gz
bcm5719-llvm-aa99c94e2a75e86381bcc45de61c11725a1484d6.zip
Revert 85678/85680. The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 749f16f7f3b..68527e3d474 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2274,12 +2274,11 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
std::vector<BlockAddrRefTy> &RefList = BAFRI->second;
for (unsigned i = 0, e = RefList.size(); i != e; ++i) {
unsigned BlockIdx = RefList[i].first;
- if (BlockIdx > FunctionBBs.size())
+ if (BlockIdx >= FunctionBBs.size())
return Error("Invalid blockaddress block #");
GlobalVariable *FwdRef = RefList[i].second;
- BasicBlock *BB = BlockIdx == 0 ? 0 : FunctionBBs[BlockIdx-1];
- FwdRef->replaceAllUsesWith(BlockAddress::get(F, BB));
+ FwdRef->replaceAllUsesWith(BlockAddress::get(F, FunctionBBs[BlockIdx]));
FwdRef->eraseFromParent();
}
OpenPOWER on IntegriCloud