From 11381662896e1961df2f94a5f044e892d9baf93a Mon Sep 17 00:00:00 2001 From: Paul Berg <9824244+Pangoraw@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:05:34 +0100 Subject: [PATCH] wasm: allow non-int vectors The current Wasm ABI classification function fails to handle non-integer vectors because of the call to `intInfo`. --- src/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 index 2b3e53b117..be9c197302 100644 --- 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));