diff --git a/crates/interpreter/src/interpreter/shared_memory.rs b/crates/interpreter/src/interpreter/shared_memory.rs index b330412418..c49cc319ed 100644 --- a/crates/interpreter/src/interpreter/shared_memory.rs +++ b/crates/interpreter/src/interpreter/shared_memory.rs @@ -296,7 +296,7 @@ impl SharedMemory { /// Returns a mutable reference to the memory of the current context. #[inline] - fn context_memory_mut(&mut self) -> &mut [u8] { + pub fn context_memory_mut(&mut self) -> &mut [u8] { let buf_len = self.buffer.len(); // SAFETY: access bounded by buffer length unsafe { self.buffer.get_unchecked_mut(self.last_checkpoint..buf_len) } diff --git a/crates/interpreter/src/interpreter/stack.rs b/crates/interpreter/src/interpreter/stack.rs index 9692695cf2..2b2c9b6d7f 100644 --- a/crates/interpreter/src/interpreter/stack.rs +++ b/crates/interpreter/src/interpreter/stack.rs @@ -58,13 +58,19 @@ impl Stack { self.data.is_empty() } - /// Returns the underlying data of the stack. + /// Returns a reference to the underlying data buffer. #[inline] pub fn data(&self) -> &Vec { &self.data } - /// Consumes the stack and returns the underlying data. + /// Returns a mutable reference to the underlying data buffer. + #[inline] + pub fn data_mut(&mut self) -> &mut Vec { + &mut self.data + } + + /// Consumes the stack and returns the underlying data buffer. #[inline] pub fn into_data(self) -> Vec { self.data