diff options
author | Kai Nacke <kai.nacke@redstar.de> | 2013-05-14 16:30:51 +0000 |
---|---|---|
committer | Kai Nacke <kai.nacke@redstar.de> | 2013-05-14 16:30:51 +0000 |
commit | 9a224ced0f27a53b1ca2bfa2acf66dbc521cc4a6 (patch) | |
tree | 63da9b7cb08e1fab7e33ce2b6bd1424270706297 /llvm/lib/CodeGen/SjLjEHPrepare.cpp | |
parent | bd7c6e5015177cf50e8094bcb7cb863d9f91b4e5 (diff) | |
download | bcm5719-llvm-9a224ced0f27a53b1ca2bfa2acf66dbc521cc4a6.tar.gz bcm5719-llvm-9a224ced0f27a53b1ca2bfa2acf66dbc521cc4a6.zip |
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
llvm-svn: 181802
Diffstat (limited to 'llvm/lib/CodeGen/SjLjEHPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SjLjEHPrepare.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp index 3903743878b..23984e9986a 100644 --- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp +++ b/llvm/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"); |