aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berg <9824244+Pangoraw@users.noreply.github.com>2024-02-12 14:05:34 +0100
committerPaul Berg <paul.berg@univ-ubs.fr>2024-02-14 09:28:20 +0100
commit11381662896e1961df2f94a5f044e892d9baf93a (patch)
tree9d90cbbbefb5078da27508d977ed3af72064e0ef
parent3f5593205dd687e9c637d7c34bd05b3ba53c2312 (diff)
downloadzig-11381662896e1961df2f94a5f044e892d9baf93a.tar.gz
zig-11381662896e1961df2f94a5f044e892d9baf93a.zip
wasm: allow non-int vectors
The current Wasm ABI classification function fails to handle non-integer vectors because of the call to `intInfo`.
-rw-r--r--src/arch/wasm/abi.zig3
1 files changed, 2 insertions, 1 deletions
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));