diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-26 19:14:54 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-26 19:14:54 +0100 |
| commit | 1f6ac248e106f77dee20af26567c61b2a35b75ba (patch) | |
| tree | b1bb054432d236311c50bce1f6be5b9c6bf1d754 /crates | |
| parent | 8adce672578683dcc7ab62e5492e0f5dbc07a0b4 (diff) | |
fix: import param order
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/tinywasm/src/runtime/stack/value_stack.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/tinywasm/src/runtime/stack/value_stack.rs b/crates/tinywasm/src/runtime/stack/value_stack.rs index bb4e398..f8f0951 100644 --- a/crates/tinywasm/src/runtime/stack/value_stack.rs +++ b/crates/tinywasm/src/runtime/stack/value_stack.rs @@ -1,6 +1,5 @@ use core::ops::Range; -use crate::log; use crate::{runtime::RawWasmValue, Error, Result}; use alloc::vec::Vec; use tinywasm_types::{ValType, WasmValue}; @@ -85,14 +84,7 @@ impl ValueStack { #[inline] pub(crate) fn pop_params(&mut self, types: &[ValType]) -> Result<Vec<WasmValue>> { - log::info!("pop_params: types={:?}", types); - log::info!("stack={:?}", self.stack); - - let mut res = Vec::with_capacity(types.len()); - for ty in types.iter() { - res.push(self.pop()?.attach_type(*ty)); - } - + let res = self.pop_n_rev(types.len())?.iter().zip(types.iter()).map(|(v, ty)| v.attach_type(*ty)).collect(); Ok(res) } |
