wasm_interp: end all function blocks on RETURN op

This commit is contained in:
Brian Carroll 2022-12-05 20:03:41 +00:00
parent ad2973cd8d
commit 513a346fe1
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0

View file

@ -276,6 +276,8 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
}
fn do_return(&mut self) -> Action {
self.block_loop_addrs
.truncate(self.outermost_block as usize);
if let Some((return_addr, block_depth)) = self.call_stack.pop_frame() {
if self.call_stack.is_empty() {
// We just popped the stack frame for the entry function. Terminate the program.