prevent multiply with overflow resulting in odd errors/segv
This commit is contained in:
@@ -472,7 +472,9 @@ macro_rules! resource_error_call_result {
|
|||||||
|
|
||||||
macro_rules! heap_index {
|
macro_rules! heap_index {
|
||||||
($idx:expr) => {
|
($idx:expr) => {
|
||||||
($idx) * std::mem::size_of::<HeapCellValue>()
|
std::mem::size_of::<HeapCellValue>()
|
||||||
|
.checked_mul($idx)
|
||||||
|
.unwrap()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user