Fix bug in deref of WasmPtr<T, Array>

This commit is contained in:
Lachlan Sneff 2019-03-28 22:22:46 -07:00
parent 90db12e59a
commit d9b89b46ee

View File

@ -55,8 +55,9 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
unsafe {
let cell_ptrs = memory.view::<T>().get_unchecked(
((self.offset() as usize) / mem::size_of::<T>())
..((self.offset() as usize) / mem::size_of::<T>()) + (length as usize),
((self.offset as usize) / mem::size_of::<T>()) + (index as usize)
..((self.offset() as usize) / mem::size_of::<T>())
+ ((index + length) as usize),
) as *const _;
Some(&*cell_ptrs)
}