[clang] [X86_64] fix empty structure vaarg in c++ (PR #77907)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 13 00:32:35 PST 2024
================
@@ -2989,6 +2989,11 @@ static Address EmitX86_64VAArgFromMemory(CodeGenFunction &CGF,
// an 8 byte boundary.
uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8;
+
+ if (isEmptyRecord(CGF.getContext(), Ty, true)) {
+ SizeInBytes = 0;
+ }
+
----------------
phoebewang wrote:
Suggestion:
```
uint64_t SizeInBytes = 0;
if (!isEmptyRecord(CGF.getContext(), Ty, true))
SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8;
```
https://github.com/llvm/llvm-project/pull/77907
More information about the cfe-commits
mailing list