@@ -4472,7 +4472,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
4472
4472
// pad. The best solution is to fix the personality function.
4473
4473
} else {
4474
4474
// Pull the pointer for the reference type off.
4475
- llvm::Type *PtrTy = LLVMCatchTy-> getPointerElementType ( );
4475
+ llvm::Type *PtrTy = CGF. ConvertTypeForMem (CaughtType );
4476
4476
4477
4477
// Create the temporary and write the adjusted pointer into it.
4478
4478
Address ExnPtrTmp =
@@ -4555,7 +4555,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
4555
4555
if (!copyExpr) {
4556
4556
llvm::Value *rawAdjustedExn = CallBeginCatch (CGF, Exn, true );
4557
4557
Address adjustedExn (CGF.Builder .CreateBitCast (rawAdjustedExn, PtrTy),
4558
- caughtExnAlignment);
4558
+ LLVMCatchTy, caughtExnAlignment);
4559
4559
LValue Dest = CGF.MakeAddrLValue (ParamAddr, CatchType);
4560
4560
LValue Src = CGF.MakeAddrLValue (adjustedExn, CatchType);
4561
4561
CGF.EmitAggregateCopy (Dest, Src, CatchType, AggValueSlot::DoesNotOverlap);
@@ -4569,7 +4569,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
4569
4569
4570
4570
// Cast that to the appropriate type.
4571
4571
Address adjustedExn (CGF.Builder .CreateBitCast (rawAdjustedExn, PtrTy),
4572
- caughtExnAlignment);
4572
+ LLVMCatchTy, caughtExnAlignment);
4573
4573
4574
4574
// The copy expression is defined in terms of an OpaqueValueExpr.
4575
4575
// Find it and map it to the adjusted expression.
0 commit comments