Skip to content

Commit

Permalink
ByteAddressableBuffer: fix oob calculation being too strict
Browse files Browse the repository at this point in the history
  • Loading branch information
Firestar99 committed Dec 17, 2024
1 parent 674dca7 commit dc2b6de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/spirv-std/src/byte_addressable_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn bounds_check<T>(data: &[u32], byte_index: u32) {
panic!("`byte_index` should be a multiple of 4");
}
let last_byte = byte_index + sizeof;
let len = data.len() as u32;
let len = data.len() as u32 * 4;
if byte_index + sizeof > len {
panic!(
"index out of bounds: the len is {} but loading {} bytes at `byte_index` {} reads until {} (exclusive)",
Expand Down

0 comments on commit dc2b6de

Please sign in to comment.