aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-03-30 19:20:53 +0000
committerGabor Greif <ggreif@gmail.com>2010-03-30 19:20:53 +0000
commit06253c42270ec5bc5898cbfe16c3895477ea8e3d (patch)
treece4d64e2ded4688474b5b4b69a67fa83d69e7dba /lib/Transforms/Utils/SimplifyCFG.cpp
parentd1575c1c917ad1194f6996770e8caf3158e53113 (diff)
downloadexternal_llvm-06253c42270ec5bc5898cbfe16c3895477ea8e3d.tar.gz
external_llvm-06253c42270ec5bc5898cbfe16c3895477ea8e3d.tar.bz2
external_llvm-06253c42270ec5bc5898cbfe16c3895477ea8e3d.zip
fix two cases where the arguments were extracted from the wrong range out of the InvokeInst
spotted by baldrick -- thanks\! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 2ce5bdcd61..bdf366a21c 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/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;