Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit c152a0c

Browse files
authored
Merge pull request #3093 from kinke/stdarg
[stable] Fix regressions crept in with core.stdc.stdarg refactoring merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 15955a1 + 87b1d4e commit c152a0c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/core/internal/vararg/aarch64.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ T va_arg(T)(ref va_list ap)
7070
else
7171
alias FundamentalType = ArgTypes[0];
7272

73-
static if (__traits(isFloating, FundamentalType) || isVectorType!FundamentalType)
73+
static if (__traits(isFloating, FundamentalType) || is(FundamentalType == __vector))
7474
{
7575
import core.stdc.string : memcpy;
7676

src/core/stdc/stdarg.d

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,16 @@ T va_arg(T)(ref va_list ap)
186186
ap += T.sizeof;
187187
return *p;
188188
}
189-
190-
// passed indirectly by value if > 64 bits or of a size that is not a power of 2
191-
static if (T.sizeof > size_t.sizeof || (T.sizeof & (T.sizeof - 1)) != 0)
192-
auto p = *cast(T**) ap;
193189
else
194-
auto p = cast(T*) ap;
195-
ap += size_t.sizeof;
196-
return *p;
190+
{
191+
// passed indirectly by value if > 64 bits or of a size that is not a power of 2
192+
static if (T.sizeof > size_t.sizeof || (T.sizeof & (T.sizeof - 1)) != 0)
193+
auto p = *cast(T**) ap;
194+
else
195+
auto p = cast(T*) ap;
196+
ap += size_t.sizeof;
197+
return *p;
198+
}
197199
}
198200
else version (SysV_x64)
199201
{

0 commit comments

Comments
 (0)