diff --git a/crates/it-lilo/src/lowerer/memory_writer.rs b/crates/it-lilo/src/lowerer/memory_writer.rs index 5c6f10f..722b52f 100644 --- a/crates/it-lilo/src/lowerer/memory_writer.rs +++ b/crates/it-lilo/src/lowerer/memory_writer.rs @@ -21,7 +21,6 @@ use crate::traits::DEFAULT_MEMORY_INDEX; use crate::utils::type_tag_form_itype; use std::cell::Cell; -use crate::lowerer::LoError; pub struct MemoryWriter<'i, R: Allocatable> { heap_manager: &'i R, diff --git a/wasmer-it/src/interpreter/instructions/arrays.rs b/wasmer-it/src/interpreter/instructions/arrays.rs index 30867e9..96cc728 100644 --- a/wasmer-it/src/interpreter/instructions/arrays.rs +++ b/wasmer-it/src/interpreter/instructions/arrays.rs @@ -134,6 +134,27 @@ where Ok(()) } + IValue::ByteArray(bytearray) => { + let lo_helper = lilo::LoHelper::new(&**instance); + let lowerer = ILowerer::new(&lo_helper) + .map_err(|e| InstructionError::from_lo(instruction.clone(), e))?; + + let offset = lowerer + .writer + .write_bytes(&bytearray) + .map_err(|e| InstructionError::from_lo(instruction.clone(), e))?; + let size = bytearray.len(); + + log::trace!( + "array.lower_memory: pushing bytes {}, {} on the stack", + offset, + size + ); + runtime.stack.push(IValue::I32(offset as _)); + runtime.stack.push(IValue::I32(size as _)); + + Ok(()) + } _ => instr_error!( instruction.clone(), InstructionErrorKind::InvalidValueOnTheStack { diff --git a/wasmer-it/src/interpreter/instructions/byte_arrays.rs b/wasmer-it/src/interpreter/instructions/byte_arrays.rs index 18a6d7d..a7aa715 100644 --- a/wasmer-it/src/interpreter/instructions/byte_arrays.rs +++ b/wasmer-it/src/interpreter/instructions/byte_arrays.rs @@ -18,7 +18,6 @@ executable_instruction!( InstructionErrorKind::StackIsTooSmall { needed: 2 }, ) })?; - println!("byte_array lift memory: {:?}", inputs); let memory_index = 0; let memory = runtime @@ -40,8 +39,6 @@ executable_instruction!( .map_err(|e| (e, "length").into()) .map_err(|k| InstructionError::from_error_kind(instruction.clone(), k))?; - println!("byte_array lift memory: pointer {} length {}", pointer, length); - let memory_view = memory.view(); if length == 0 {