Skip to content

Commit 1aeb4c6

Browse files
committed
[ItaniumCXXABI] Avoid pointer element type accesses
1 parent 506eb6c commit 1aeb4c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4472,7 +4472,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
44724472
// pad. The best solution is to fix the personality function.
44734473
} else {
44744474
// Pull the pointer for the reference type off.
4475-
llvm::Type *PtrTy = LLVMCatchTy->getPointerElementType();
4475+
llvm::Type *PtrTy = CGF.ConvertTypeForMem(CaughtType);
44764476

44774477
// Create the temporary and write the adjusted pointer into it.
44784478
Address ExnPtrTmp =
@@ -4555,7 +4555,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
45554555
if (!copyExpr) {
45564556
llvm::Value *rawAdjustedExn = CallBeginCatch(CGF, Exn, true);
45574557
Address adjustedExn(CGF.Builder.CreateBitCast(rawAdjustedExn, PtrTy),
4558-
caughtExnAlignment);
4558+
LLVMCatchTy, caughtExnAlignment);
45594559
LValue Dest = CGF.MakeAddrLValue(ParamAddr, CatchType);
45604560
LValue Src = CGF.MakeAddrLValue(adjustedExn, CatchType);
45614561
CGF.EmitAggregateCopy(Dest, Src, CatchType, AggValueSlot::DoesNotOverlap);
@@ -4569,7 +4569,7 @@ static void InitCatchParam(CodeGenFunction &CGF,
45694569

45704570
// Cast that to the appropriate type.
45714571
Address adjustedExn(CGF.Builder.CreateBitCast(rawAdjustedExn, PtrTy),
4572-
caughtExnAlignment);
4572+
LLVMCatchTy, caughtExnAlignment);
45734573

45744574
// The copy expression is defined in terms of an OpaqueValueExpr.
45754575
// Find it and map it to the adjusted expression.

0 commit comments

Comments
 (0)