Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 78b0712

Browse files
committed
core.stdc.stdarg: fix va_arg() for x86 platform.
LLVM's intrinsic apparently doesn't work for aggregate types.
1 parent a8a7cd6 commit 78b0712

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/core/stdc/stdarg.d

+11
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ version( LDC )
337337
ap += size_t.sizeof;
338338
return arg;
339339
}
340+
else version( X86 )
341+
{
342+
T arg = *cast(T*)ap;
343+
ap += (T.sizeof + size_t.sizeof - 1) & ~(size_t.sizeof - 1);
344+
return arg;
345+
}
340346
else version( ARM )
341347
{
342348
T arg = *cast(T*)ap;
@@ -361,6 +367,11 @@ version( LDC )
361367
parmn = *cast(T*)ap;
362368
ap += size_t.sizeof;
363369
}
370+
else version( X86 )
371+
{
372+
parmn = *cast(T*)ap;
373+
ap += (T.sizeof + size_t.sizeof - 1) & ~(size_t.sizeof - 1);
374+
}
364375
else version( ARM )
365376
{
366377
parmn = *cast(T*)ap;

0 commit comments

Comments
 (0)