From ed1a0ce79aa02614754cb8618d88accf5f54c395 Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Mon, 6 Jan 2025 18:19:01 +0900 Subject: [PATCH 1/2] Fix != 0 check in rvsol --- rvsol/src/RISCV.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rvsol/src/RISCV.sol b/rvsol/src/RISCV.sol index 1bbb681e..366403b7 100644 --- a/rvsol/src/RISCV.sol +++ b/rvsol/src/RISCV.sol @@ -888,7 +888,7 @@ contract RISCV is IBigStepper { let errCode := 0 // ensure MAP_ANONYMOUS is set and fd == -1 - switch or(iszero(and(flags, 0x20)), not(eq(fd, u64Mask()))) + switch or(iszero(and(flags, 0x20)), eq(eq(fd, u64Mask()), 0)) case 1 { addr := u64Mask() errCode := toU64(0x4d) From e5a584226fab1b0c6c2aae4ffebf2a5e7cd8c60b Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Tue, 7 Jan 2025 13:28:29 +0900 Subject: [PATCH 2/2] Use iszero for consistency --- rvsol/src/RISCV.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rvsol/src/RISCV.sol b/rvsol/src/RISCV.sol index 366403b7..7c5d0c8e 100644 --- a/rvsol/src/RISCV.sol +++ b/rvsol/src/RISCV.sol @@ -888,7 +888,7 @@ contract RISCV is IBigStepper { let errCode := 0 // ensure MAP_ANONYMOUS is set and fd == -1 - switch or(iszero(and(flags, 0x20)), eq(eq(fd, u64Mask()), 0)) + switch or(iszero(and(flags, 0x20)), iszero(eq(fd, u64Mask()))) case 1 { addr := u64Mask() errCode := toU64(0x4d)