From baf3941fde99332560c171d77f64554ad90ccf23 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 28 Sep 2011 03:52:41 +0000 Subject: [PATCH] Strip off pointer casts when looking at the eh.sjlj.functioncontext's argument. llvm-svn: 140678 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index b2b93c9ff57a..2bfb529a5688 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4757,7 +4757,8 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { case Intrinsic::eh_sjlj_functioncontext: { // Get and store the index of the function context. MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); - AllocaInst *FnCtx = cast(I.getArgOperand(0)); + AllocaInst *FnCtx = + cast(I.getArgOperand(0)->stripPointerCasts()); int FI = FuncInfo.StaticAllocaMap[FnCtx]; MFI->setFunctionContextIndex(FI); return 0;