Skip to content

Commit

Permalink
Add support for local.tee to wasm-bindgen-wasm-interpreter
Browse files Browse the repository at this point in the history
This doesn't solve rustwasm#2969, since WASI uses plenty of instructions we don't support aside from `local.tee`, but it hopefully might solve [@tv42's issue](rustwasm#2969 (comment)).
  • Loading branch information
Liamolucko committed Jan 12, 2023
1 parent 3c1f5a9 commit 21e0ac3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/wasm-interpreter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ impl Frame<'_> {
let val = stack.pop().unwrap();
self.locals.insert(e.local, val);
}
Instr::LocalTee(e) => {
let val = stack.last().unwrap().clone();
self.locals.insert(e.local, val);
}

// Blindly assume all globals are the stack pointer
Instr::GlobalGet(_) => stack.push(self.interp.sp),
Expand Down

0 comments on commit 21e0ac3

Please sign in to comment.