Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions crates/interpreter/src/interpreter/shared_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,13 @@ impl SharedMemory {
///
/// # Panics
///
/// Panics on out of bounds.
/// Panics on out of bounds access in debug builds only.
///
/// # Safety
///
/// In release builds, calling this method with an out-of-bounds range triggers undefined
/// behavior. Callers must ensure that the range is within the bounds of the memory (i.e.,
/// `range.end <= self.len()`).
#[inline]
#[cfg_attr(debug_assertions, track_caller)]
pub fn slice_range(&self, range: Range<usize>) -> Ref<'_, [u8]> {
Expand Down Expand Up @@ -270,7 +276,13 @@ impl SharedMemory {
///
/// # Panics
///
/// Panics on out of bounds.
/// Panics on out of bounds access in debug builds only.
///
/// # Safety
///
/// In release builds, calling this method with out-of-bounds parameters triggers undefined
/// behavior. Callers must ensure that `offset + size` does not exceed the length of the
/// memory.
#[inline]
#[cfg_attr(debug_assertions, track_caller)]
pub fn slice_mut(&mut self, offset: usize, size: usize) -> RefMut<'_, [u8]> {
Expand Down
Loading