From a2ab3132df50753f8cc403f072c2a8b5b950f20e Mon Sep 17 00:00:00 2001 From: jeffkdev <18176443+jeffkdev@users.noreply.github.com> Date: Tue, 5 May 2026 11:50:30 -0400 Subject: [PATCH] wasm futex: fix invalid cast from u64 to i64 --- lib/std/Io/Threaded.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 9cac2f12a41052cbfe347feeafd3954a1e4983b9..bc7fd2d2c8e6ac271c33099c18fb94fc0634615b 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -956,7 +956,7 @@ const Thread = struct { comptime assert(builtin.cpu.has(.wasm, .atomics)); // TODO implement cancelation for WASM futex waits by signaling the futex if (!uncancelable) try Thread.checkCancel(); - const to: i64 = if (timeout_ns) |ns| ns else -1; + const to: i64 = if (timeout_ns) |ns| std.math.cast(i64, ns) orelse std.math.maxInt(i64) else -1; const signed_expect: i32 = @bitCast(expect); const result = asm volatile ( \\local.get %[ptr] -- 2.54.0