zig

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

commit a2ab3132df50753f8cc403f072c2a8b5b950f20e (tree)
parent 73d20ecd6a558cde8a8341de3c348895a006f49c
Author: jeffkdev <18176443+jeffkdev@users.noreply.github.com>
Date:   Tue,  5 May 2026 11:50:30 -0400

wasm futex: fix invalid cast from u64 to i64

Diffstat:
Mlib/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 @@ -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]