From 3c268263e45f4bb2af39cd07c1c6545092fc9f69 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 7 Nov 2025 12:21:27 +0100 Subject: br_if.c: Consider both MSB and LSB for i64 Otherwise, values such as 0x100000000 (i.e., the 32th-bit is set) would not cause a branch because only the lower 32 bits would be tested. --- src/op/br_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/op/br_if.c b/src/op/br_if.c index 661c959..5b6b5a2 100644 --- a/src/op/br_if.c +++ b/src/op/br_if.c @@ -26,7 +26,7 @@ static int condition(struct nw_interp *const i) return b->condition.i32; case NW_TYPE_I64: - return b->condition.i64.low; + return b->condition.i64.low || b->condition.i64.hi; case NW_TYPE_F32: return b->condition.f32; -- cgit v1.2.3