Skip to content

Commit c74876a

Browse files
[WASM] Fix test/stdlib/VarArgs.swift
1 parent 7427540 commit c74876a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ namespace {
711711
}
712712

713713
static const llvm::StringLiteral vaListNames[] = {
714-
"va_list", "__gnuc_va_list", "__va_list"
714+
"va_list", "__gnuc_va_list", "__isoc_va_list", "__va_list"
715715
};
716716

717717
ImportHint hint = ImportHint::None;

lib/ClangImporter/MappedTypes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ MAP_STDLIB_TYPE("u_int64_t", UnsignedInt, 64, "UInt64", false, DoNothing)
128128
// There's an explicit workaround in ImportType.cpp's VisitDecayedType for that.
129129
MAP_STDLIB_TYPE("va_list", VaList, 0, "CVaListPointer", false, DoNothing)
130130
MAP_STDLIB_TYPE("__gnuc_va_list", VaList, 0, "CVaListPointer", false, DoNothing)
131+
MAP_STDLIB_TYPE("__isoc_va_list", VaList, 0, "CVaListPointer", false, DoNothing)
131132
MAP_STDLIB_TYPE("__va_list", VaList, 0, "CVaListPointer", false, DoNothing)
132133

133134
// libkern/OSTypes.h types.

stdlib/public/core/VarArgs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ final internal class __VaListBuilder {
565565
// supported vararg type is greater than the alignment of Int, such
566566
// as non-iOS ARM. Note that we can't use alignof because it
567567
// differs from ABI alignment on some architectures.
568-
#if arch(arm) && !os(iOS)
568+
#if (arch(arm) && !os(iOS)) || arch(wasm32)
569569
if let arg = arg as? _CVarArgAligned {
570570
let alignmentInWords = arg._cVarArgAlignment / MemoryLayout<Int>.size
571571
let misalignmentInWords = count % alignmentInWords

0 commit comments

Comments
 (0)