mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-14 06:35:40 +00:00
Fix bug in deref of WasmPtr<T, Array>
This commit is contained in:
parent
90db12e59a
commit
d9b89b46ee
@ -55,8 +55,9 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let cell_ptrs = memory.view::<T>().get_unchecked(
|
let cell_ptrs = memory.view::<T>().get_unchecked(
|
||||||
((self.offset() as usize) / mem::size_of::<T>())
|
((self.offset as usize) / mem::size_of::<T>()) + (index as usize)
|
||||||
..((self.offset() as usize) / mem::size_of::<T>()) + (length as usize),
|
..((self.offset() as usize) / mem::size_of::<T>())
|
||||||
|
+ ((index + length) as usize),
|
||||||
) as *const _;
|
) as *const _;
|
||||||
Some(&*cell_ptrs)
|
Some(&*cell_ptrs)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user