Skip to content

Commit 530bca3

Browse files
committed
fix integer-overflow bug in encode_return
1 parent c2b42c7 commit 530bca3

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ impl FuncTranslator {
909909
},
910910
_ => {
911911
self.move_operands_to_temp(usize::from(len_results), consume_fuel)?;
912-
let result0 = self.stack.peek(usize::from(len_results));
912+
let result0 = self.stack.peek(usize::from(len_results) - 1);
913913
let slot0 = self.layout.temp_to_slot(result0.index())?;
914914
Op::return_span(BoundedSlotSpan::new(SlotSpan::new(slot0), len_results))
915915
}

0 commit comments

Comments
 (0)