Skip to content

Commit 49c874b

Browse files
committed
fix bug in translate_br_if fallback
1 parent 4da16af commit 49c874b

File tree

1 file changed

+5
-1
lines changed
  • crates/wasmi/src/engine/translator/func2

1 file changed

+5
-1
lines changed

crates/wasmi/src/engine/translator/func2/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ impl FuncTranslator {
506506
},
507507
Err(_) => {
508508
let zero = self.layout.const_to_reg(0_i32)?;
509-
self.make_branch_cmp_fallback(Comparator::I32Eq, condition, zero, offset)?
509+
let comparator = match branch_eqz {
510+
true => Comparator::I32Eq,
511+
false => Comparator::I32Ne,
512+
};
513+
self.make_branch_cmp_fallback(comparator, condition, zero, offset)?
510514
}
511515
};
512516
self.push_instr(instr, FuelCostsProvider::base)

0 commit comments

Comments
 (0)