mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
stage2: fix x86_64-windows C ABI
It didn't return integer status for pointers and also it incorrectly returned memory for optionals sometimes.
This commit is contained in:
parent
61ed4fe07a
commit
e06ac9537e
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user