mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-28 16:11:32 +00:00
fix newly introduced bug in wasmptr array access
This commit is contained in:
@ -72,7 +72,7 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
|||||||
mem::align_of::<T>(),
|
mem::align_of::<T>(),
|
||||||
) as *const Cell<T>;
|
) as *const Cell<T>;
|
||||||
let cell_ptrs = &std::slice::from_raw_parts(cell_ptr, slice_full_len)
|
let cell_ptrs = &std::slice::from_raw_parts(cell_ptr, slice_full_len)
|
||||||
[index as usize..length as usize];
|
[index as usize..slice_full_len as usize];
|
||||||
Some(cell_ptrs)
|
Some(cell_ptrs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
|||||||
mem::align_of::<T>(),
|
mem::align_of::<T>(),
|
||||||
) as *const Cell<T>;
|
) as *const Cell<T>;
|
||||||
let cell_ptrs = &std::slice::from_raw_parts(cell_ptr, slice_full_len)
|
let cell_ptrs = &std::slice::from_raw_parts(cell_ptr, slice_full_len)
|
||||||
[index as usize..length as usize];
|
[index as usize..slice_full_len];
|
||||||
Ok(cell_ptrs)
|
Ok(cell_ptrs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user