summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKai Nacke <kai.nacke@redstar.de>2013-05-14 16:30:51 +0000
committerKai Nacke <kai.nacke@redstar.de>2013-05-14 16:30:51 +0000
commite4642bc096984c12c1ef129137e17fad61201118 (patch)
treebec5d587f543ff3fe6396d1e68d0cd5ee631fabf /lib
parented788b62830c26bd1f5d23d73a6337c88b66ab61 (diff)
downloadexternal_llvm-e4642bc096984c12c1ef129137e17fad61201118.zip
external_llvm-e4642bc096984c12c1ef129137e17fad61201118.tar.gz
external_llvm-e4642bc096984c12c1ef129137e17fad61201118.tar.bz2
Add bitcast to store of personality function.
The personality function is user defined and may have an arbitrary result type. The code assumes always i8*. This results in an assertion failure if a different type is used. A bitcast to i8* is added to prevent this failure. Reviewed by: Renato Golin, Bob Wilson git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SjLjEHPrepare.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp
index 3903743..23984e9 100644
--- a/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/lib/CodeGen/SjLjEHPrepare.cpp
@@ -222,7 +222,9 @@ setupFunctionContext(Function &F, ArrayRef<LandingPadInst*> LPads) {
PersonalityFn = LPads[0]->getPersonalityFn();
Value *PersonalityFieldPtr = Builder.CreateConstGEP2_32(FuncCtx, 0, 3,
"pers_fn_gep");
- Builder.CreateStore(PersonalityFn, PersonalityFieldPtr, /*isVolatile=*/true);
+ Builder.CreateStore(Builder.CreateBitCast(PersonalityFn,
+ Builder.getInt8PtrTy()),
+ PersonalityFieldPtr, /*isVolatile=*/true);
// LSDA address
Value *LSDA = Builder.CreateCall(LSDAAddrFn, "lsda_addr");