Strip off pointer casts when looking at the eh.sjlj.functioncontext's argument.
authorBill Wendling <isanbard@gmail.com>
Wed, 28 Sep 2011 03:52:41 +0000 (03:52 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 28 Sep 2011 03:52:41 +0000 (03:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140678 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index b2b93c9ff57a1dba845cc85a216e0bc9a0e6cee7..2bfb529a5688b0c83fa7c356e38cd5d55dbb4b6e 100644 (file)
@@ -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<AllocaInst>(I.getArgOperand(0));
+    AllocaInst *FnCtx =
+      cast<AllocaInst>(I.getArgOperand(0)->stripPointerCasts());
     int FI = FuncInfo.StaticAllocaMap[FnCtx];
     MFI->setFunctionContextIndex(FI);
     return 0;