================ @@ -2988,7 +2988,10 @@ static Address EmitX86_64VAArgFromMemory(CodeGenFunction &CGF, // AMD64-ABI 3.5.7p5: Step 10. Align l->overflow_arg_area upwards to // an 8 byte boundary. - uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8; + uint64_t SizeInBytes = 0; + if (!isEmptyRecord(CGF.getContext(), Ty, true, true)) + SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8; ---------------- efriedma-quic wrote:
Using isEmptyRecord() like this doesn't seem right. I mean, it's probably pretty close to being correct in most cases, but I suspect there are edge cases where it does something slightly different. Also, as far as I can tell, we aren't supposed to realign the va_list if an argument is empty (which could matter for an empty struct with an alignment attribute). I think we should be using the result of classifyArgumentType() here to check what to do here. If the ABIArgInfo is "ignore", the argument isn't passed at all, so we shouldn't access the va_list. We should just make a temporary and return its address. https://github.com/llvm/llvm-project/pull/77907 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits