Skip to content

Commit cfb3f9c

Browse files
committed
remove short-circuiting from wasmi_i32_and
This is incorrect as demonstrated by the following example: - `(1 & 2) == 0` - `(1 != 0) && (2 != 0) == 1`
1 parent 83d900f commit cfb3f9c

File tree

1 file changed

+1
-1
lines changed
  • crates/wasmi/src/engine/executor/handler

1 file changed

+1
-1
lines changed

crates/wasmi/src/engine/executor/handler/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn wasmi_i64_rotr_ssi(lhs: i64, rhs: u8) -> i64 {
7777
}
7878

7979
pub fn wasmi_i32_and(lhs: i32, rhs: i32) -> bool {
80-
(rhs != 0) && (lhs != 0)
80+
(lhs & rhs) != 0
8181
}
8282

8383
pub fn wasmi_i32_not_and(lhs: i32, rhs: i32) -> bool {

0 commit comments

Comments
 (0)