[llvm] r181802 - Add bitcast to store of personality function.

Bill Wendling wendling at apple.com
Wed May 15 17:15:57 PDT 2013


Good catch! Yeah, the code was making an assumption about what the front-end was generating. Sorry about the error.

-bw

On May 14, 2013, at 9:30 AM, Kai Nacke <kai.nacke at redstar.de> wrote:

> Author: redstar
> Date: Tue May 14 11:30:51 2013
> New Revision: 181802
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=181802&view=rev
> Log:
> 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
> 
> Modified:
>    llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp
> 
> Modified: llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp?rev=181802&r1=181801&r2=181802&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp Tue May 14 11:30:51 2013
> @@ -222,7 +222,9 @@ setupFunctionContext(Function &F, ArrayR
>     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");
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list