diff --git a/src/interpreter/instructions/argument_get.rs b/src/interpreter/instructions/argument_get.rs index 8819302..0a67909 100644 --- a/src/interpreter/instructions/argument_get.rs +++ b/src/interpreter/instructions/argument_get.rs @@ -1,6 +1,6 @@ executable_instruction!( argument_get(index: u64, instruction_name: String) -> _ { - Box::new(move |runtime| -> _ { + move |runtime| -> _ { let invocation_inputs = runtime.invocation_inputs; if index >= (invocation_inputs.len() as u64) { @@ -13,7 +13,7 @@ executable_instruction!( runtime.stack.push(invocation_inputs[index as usize].clone()); Ok(()) - }) + } } ); diff --git a/src/interpreter/instructions/call.rs b/src/interpreter/instructions/call.rs index 4a74655..d58368c 100644 --- a/src/interpreter/instructions/call.rs +++ b/src/interpreter/instructions/call.rs @@ -5,7 +5,7 @@ use crate::interpreter::wasm::{ executable_instruction!( call(function_index: usize, instruction_name: String) -> _ { - Box::new(move |runtime| -> _ { + move |runtime| -> _ { let instance = runtime.wasm_instance; let index = FunctionIndex::new(function_index); @@ -58,7 +58,7 @@ executable_instruction!( function_index, )) } - }) + } } ); diff --git a/src/interpreter/instructions/call_export.rs b/src/interpreter/instructions/call_export.rs index 05de647..a1a4340 100644 --- a/src/interpreter/instructions/call_export.rs +++ b/src/interpreter/instructions/call_export.rs @@ -2,7 +2,7 @@ use crate::interpreter::wasm::values::InterfaceType; executable_instruction!( call_export(export_name: String, instruction_name: String) -> _ { - Box::new(move |runtime| -> _ { + move |runtime| -> _ { let instance = runtime.wasm_instance; match instance.export(&export_name) { @@ -54,7 +54,7 @@ executable_instruction!( export_name, )) } - }) + } } ); diff --git a/src/interpreter/instructions/read_utf8.rs b/src/interpreter/instructions/read_utf8.rs index 8f195fd..55fe350 100644 --- a/src/interpreter/instructions/read_utf8.rs +++ b/src/interpreter/instructions/read_utf8.rs @@ -3,7 +3,7 @@ use std::{cell::Cell, convert::TryFrom}; executable_instruction!( read_utf8(instruction_name: String) -> _ { - Box::new(move |runtime| -> _ { + move |runtime| -> _ { match runtime.stack.pop(2) { Some(inputs) => match runtime.wasm_instance.memory(0) { Some(memory) => { @@ -48,7 +48,7 @@ executable_instruction!( instruction_name, )) } - }) + } } ); diff --git a/src/interpreter/instructions/write_utf8.rs b/src/interpreter/instructions/write_utf8.rs index fa66621..34e148f 100644 --- a/src/interpreter/instructions/write_utf8.rs +++ b/src/interpreter/instructions/write_utf8.rs @@ -3,7 +3,7 @@ use std::convert::TryInto; executable_instruction!( write_utf8(allocator_name: String, instruction_name: String) -> _ { - Box::new(move |runtime| -> _ { + move |runtime| -> _ { let instance = runtime.wasm_instance; match instance.export(&allocator_name) { @@ -67,7 +67,7 @@ executable_instruction!( allocator_name )) } - }) + } } ); diff --git a/src/macros.rs b/src/macros.rs index e6c0abf..2d2e146 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -37,7 +37,7 @@ macro_rules! executable_instruction { Memory: wasm::structures::Memory, Instance: wasm::structures::Instance, { - $implementation + Box::new($implementation) } }; }