zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit e06ac9537e94cf4863de7ca64112d7a63af60008 (tree)
parent 61ed4fe07ad660f3cb4372937ccd5188ce404a44
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue,  8 Feb 2022 21:10:29 -0700

stage2: fix x86_64-windows C ABI

It didn't return integer status for pointers and also it incorrectly
returned memory for optionals sometimes.

Diffstat:
Msrc/arch/x86_64/abi.zig | 30+++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/arch/x86_64/abi.zig b/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, }; }