zig

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

commit 11381662896e1961df2f94a5f044e892d9baf93a (tree)
parent 3f5593205dd687e9c637d7c34bd05b3ba53c2312
Author: Paul Berg <9824244+Pangoraw@users.noreply.github.com>
Date:   Mon, 12 Feb 2024 14:05:34 +0100

wasm: allow non-int vectors

The current Wasm ABI classification function fails to handle non-integer
vectors because of the call to `intInfo`.

Diffstat:
Msrc/arch/wasm/abi.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/arch/wasm/abi.zig b/src/arch/wasm/abi.zig @@ -45,7 +45,7 @@ pub fn classifyType(ty: Type, mod: *Module) [2]Class { } return classifyType(field_ty, mod); }, - .Int, .Enum, .ErrorSet, .Vector => { + .Int, .Enum, .ErrorSet => { const int_bits = ty.intInfo(mod).bits; if (int_bits <= 64) return direct; if (int_bits <= 128) return .{ .direct, .direct }; @@ -58,6 +58,7 @@ pub fn classifyType(ty: Type, mod: *Module) [2]Class { return memory; }, .Bool => return direct, + .Vector => return direct, .Array => return memory, .Optional => { assert(ty.isPtrLikeOptional(mod));