diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-03-30 19:20:53 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-03-30 19:20:53 +0000 |
commit | b4698182793248d943518918302db4228ae16a91 (patch) | |
tree | 1e442dbad3e517f73cd00778449c860e07eae5b3 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | ad2c6988a28e5e506c29980c785a167c9b0f3294 (diff) | |
download | bcm5719-llvm-b4698182793248d943518918302db4228ae16a91.tar.gz bcm5719-llvm-b4698182793248d943518918302db4228ae16a91.zip |
fix two cases where the arguments were extracted from the wrong range out of the InvokeInst
spotted by baldrick -- thanks\!
llvm-svn: 99914
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 2ce5bdcd61d..bdf366a21c2 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1768,7 +1768,7 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) { Pred->getInstList().remove(II); // Take out of symbol table // Insert the call now. - SmallVector<Value*,8> Args(II->op_begin()+3, II->op_end()); + SmallVector<Value*,8> Args(II->op_begin(), II->op_end()-3); CallInst *CI = CallInst::Create(II->getCalledValue(), Args.begin(), Args.end(), II->getName(), BI); @@ -1970,13 +1970,13 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) { II->removeFromParent(); // Take out of symbol table // Insert the call now... - SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end()); + SmallVector<Value*, 8> Args(II->op_begin(), II->op_end()-3); CallInst *CI = CallInst::Create(II->getCalledValue(), Args.begin(), Args.end(), II->getName(), BI); CI->setCallingConv(II->getCallingConv()); CI->setAttributes(II->getAttributes()); - // If the invoke produced a value, the Call does now instead. + // If the invoke produced a value, the call does now instead. II->replaceAllUsesWith(CI); delete II; Changed = true; |