prevent multiply with overflow resulting in odd errors/segv

This commit is contained in:
Skgland
2025-12-07 21:27:24 +01:00
committed by Bennet Bleßmann
parent 193cfabc66
commit 2fc08dde1e

View File

@@ -472,7 +472,9 @@ macro_rules! resource_error_call_result {
macro_rules! heap_index {
($idx:expr) => {
($idx) * std::mem::size_of::<HeapCellValue>()
std::mem::size_of::<HeapCellValue>()
.checked_mul($idx)
.unwrap()
};
}