[llvm-branch-commits] Add pointer field protection feature. (PR #133538)

Peter Collingbourne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed May 14 22:25:30 PDT 2025


================
@@ -2976,7 +3006,15 @@ void CodeGenFunction::EmitForwardingCallToLambda(
   QualType resultType = FPT->getReturnType();
   ReturnValueSlot returnSlot;
   if (!resultType->isVoidType() &&
-      calleeFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect &&
+      (calleeFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect ||
+       // With pointer field protection, we need to set up the return slot when
----------------
pcc wrote:

The return value slot for forwarding lambdas is set up in an unusual way compared to other functions. I think I first tried simplifying this to work like normal functions but that led to other problems. I agree that ideally we wouldn't need to modify this.

https://github.com/llvm/llvm-project/pull/133538


More information about the llvm-branch-commits mailing list