mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
wasm_interp: Don't panic when setting a local variable
This commit is contained in:
parent
9d912a6cc7
commit
1b126d3b58
2 changed files with 15 additions and 13 deletions
|
@ -601,12 +601,12 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
|
|||
SETLOCAL => {
|
||||
let index = self.fetch_immediate_u32(module);
|
||||
let value = self.value_stack.pop();
|
||||
self.call_stack.set_local(index, value);
|
||||
self.call_stack.set_local(index, value)?;
|
||||
}
|
||||
TEELOCAL => {
|
||||
let index = self.fetch_immediate_u32(module);
|
||||
let value = self.value_stack.peek();
|
||||
self.call_stack.set_local(index, value);
|
||||
self.call_stack.set_local(index, value)?;
|
||||
}
|
||||
GETGLOBAL => {
|
||||
let index = self.fetch_immediate_u32(module);
|
||||
|
@ -1523,7 +1523,7 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
|
|||
if let Some(debug_string) = &self.debug_string {
|
||||
let base = self.call_stack.value_stack_base();
|
||||
let slice = self.value_stack.get_slice(base as usize);
|
||||
eprintln!("{:#07x} {:17} {:?}", file_offset, debug_string, slice);
|
||||
eprintln!("{:06x} {:17} {:?}", file_offset, debug_string, slice);
|
||||
if op_code == RETURN || (op_code == END && implicit_return) {
|
||||
let fn_index = pc_to_fn_index(self.program_counter, module);
|
||||
eprintln!("returning to function {}\n", fn_index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue