Commit e06ac9537e

Andrew Kelley <andrew@ziglang.org>
2022-02-09 05:10:29
stage2: fix x86_64-windows C ABI
It didn't return integer status for pointers and also it incorrectly returned memory for optionals sometimes.
1 parent 61ed4fe
Changed files (1)
src
arch
x86_64
src/arch/x86_64/abi.zig
@@ -18,10 +18,34 @@ pub fn classifyWindows(ty: Type, target: Target) Class {
         else => return .memory,
     }
     return switch (ty.zigTypeTag()) {
-        .Int, .Bool, .Enum, .Void, .NoReturn, .ErrorSet, .Struct, .Union => .integer,
-        .Optional => if (ty.isPtrLikeOptional()) return .integer else return .memory,
+        .Pointer,
+        .Int,
+        .Bool,
+        .Enum,
+        .Void,
+        .NoReturn,
+        .ErrorSet,
+        .Struct,
+        .Union,
+        .Optional,
+        .Array,
+        .ErrorUnion,
+        .AnyFrame,
+        .Frame,
+        => .integer,
+
         .Float, .Vector => .sse,
-        else => unreachable,
+
+        .Type,
+        .ComptimeFloat,
+        .ComptimeInt,
+        .Undefined,
+        .Null,
+        .BoundFn,
+        .Fn,
+        .Opaque,
+        .EnumLiteral,
+        => unreachable,
     };
 }