From 17b3dca389c7574fcb0f65f9d57d4fab9c0e84aa Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 12 Feb 2021 17:02:19 +0000 Subject: [PATCH] f --- bindings/rust/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/rust/src/lib.rs b/bindings/rust/src/lib.rs index 7cf2e9bc7..dea24ff82 100644 --- a/bindings/rust/src/lib.rs +++ b/bindings/rust/src/lib.rs @@ -338,8 +338,8 @@ impl Instance { /// # Safety /// These slices turn invalid if the memory is resized (i.e. via the WebAssembly `memory.grow` instruction) pub unsafe fn checked_memory_slice(&self, offset: u32, size: usize) -> Result<&[u8], ()> { - let memory_data = sys::fizzy_get_instance_memory_data(self.0.as_ptr()); - let memory_size = sys::fizzy_get_instance_memory_size(self.0.as_ptr()); + let memory_data = sys::fizzy_get_instance_memory_data(self.instance.as_ptr()); + let memory_size = sys::fizzy_get_instance_memory_size(self.instance.as_ptr()); let range = Instance::checked_memory_range(memory_data, memory_size, offset, size)?; // Slices allow empty length, but data must be a valid pointer. debug_assert!(memory_data != std::ptr::null_mut()); @@ -356,8 +356,8 @@ impl Instance { offset: u32, size: usize, ) -> Result<&mut [u8], ()> { - let memory_data = sys::fizzy_get_instance_memory_data(self.0.as_ptr()); - let memory_size = sys::fizzy_get_instance_memory_size(self.0.as_ptr()); + let memory_data = sys::fizzy_get_instance_memory_data(self.instance.as_ptr()); + let memory_size = sys::fizzy_get_instance_memory_size(self.instance.as_ptr()); let range = Instance::checked_memory_range(memory_data, memory_size, offset, size)?; // Slices allow empty length, but data must be a valid pointer. debug_assert!(memory_data != std::ptr::null_mut()); @@ -367,7 +367,7 @@ impl Instance { /// Returns the current memory size, in bytes. pub fn memory_size(&self) -> usize { - unsafe { sys::fizzy_get_instance_memory_size(self.0.as_ptr()) } + unsafe { sys::fizzy_get_instance_memory_size(self.instance.as_ptr()) } } /// Copies memory from `offset` to `target`, for the length of `target.len()`.