Skip to content

Commit 3a96556

Browse files
somethingelseentirelyLuukdegram
authored andcommitted
fix bad cast
1 parent 2a3a6f7 commit 3a96556

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ pub const Func = opaque {
177177
comptime var wasm_args: [args_len]Value = undefined;
178178
inline for (wasm_args) |*arg, i| {
179179
arg.* = switch (@TypeOf(args[i])) {
180-
i32, u32 => .{ .kind = .i32, .of = .{ .i32 = @intCast(i32, args[i]) } },
181-
i64, u64 => .{ .kind = .i64, .of = .{ .i64 = @intCast(i64, args[i]) } },
180+
i32, u32 => .{ .kind = .i32, .of = .{ .i32 = @bitCast(i32, args[i]) } },
181+
i64, u64 => .{ .kind = .i64, .of = .{ .i64 = @bitCast(i64, args[i]) } },
182182
f32 => .{ .kind = .f32, .of = .{ .f32 = args[i] } },
183183
f64 => .{ .kind = .f64, .of = .{ .f64 = args[i] } },
184184
*Func => .{ .kind = .funcref, .of = .{ .ref = args[i] } },

0 commit comments

Comments
 (0)