aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerInvoke.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp
index 0da30e2428..5a4408f802 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/LowerInvoke.cpp
@@ -441,7 +441,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
std::vector<Value*> Idx;
Idx.push_back(Constant::getNullValue(Type::Int32Ty));
Idx.push_back(ConstantInt::get(Type::Int32Ty, 1));
- OldJmpBufPtr = new GetElementPtrInst(JmpBuf, Idx, "OldBuf",
+ OldJmpBufPtr = new GetElementPtrInst(JmpBuf, &Idx[0], 2, "OldBuf",
EntryBB->getTerminator());
// Copy the JBListHead to the alloca.
@@ -480,7 +480,8 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
"setjmp.cont");
Idx[1] = ConstantInt::get(Type::Int32Ty, 0);
- Value *JmpBufPtr = new GetElementPtrInst(JmpBuf, Idx, "TheJmpBuf",
+ Value *JmpBufPtr = new GetElementPtrInst(JmpBuf, &Idx[0], Idx.size(),
+ "TheJmpBuf",
EntryBB->getTerminator());
Value *SJRet = new CallInst(SetJmpFn, JmpBufPtr, "sjret",
EntryBB->getTerminator());
@@ -530,7 +531,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
std::vector<Value*> Idx;
Idx.push_back(Constant::getNullValue(Type::Int32Ty));
Idx.push_back(ConstantInt::get(Type::Int32Ty, 0));
- Idx[0] = new GetElementPtrInst(BufPtr, Idx, "JmpBuf", UnwindBlock);
+ Idx[0] = new GetElementPtrInst(BufPtr, &Idx[0], 2, "JmpBuf", UnwindBlock);
Idx[1] = ConstantInt::get(Type::Int32Ty, 1);
new CallInst(LongJmpFn, Idx, "", UnwindBlock);
new UnreachableInst(UnwindBlock);