Fix potential integer overflow issues (#4429)
It is reported as "Multiplication result converted to larger type". And "Multiplication result may overflow 'Type A' before it is converted to 'Type B'." Type A is a larger type than Type B. Since the conversion applies after the multiplication, arithmetic overflow may still occur. > The rule flags every multiplication of two non-constant integer expressions > that is (explicitly or implicitly) converted to a larger integer type. The > conversion is an indication that the expression would produce a result that > would be too large to fit in the smaller integer type.
This commit is contained in:
@ -3639,7 +3639,7 @@ aot_get_module_inst_mem_consumption(const AOTModuleInstance *module_inst,
|
||||
for (i = 0; i < module_inst->memory_count; i++) {
|
||||
AOTMemoryInstance *mem_inst = module_inst->memories[i];
|
||||
mem_conspn->memories_size +=
|
||||
mem_inst->num_bytes_per_page * mem_inst->cur_page_count;
|
||||
(uint64)mem_inst->num_bytes_per_page * mem_inst->cur_page_count;
|
||||
mem_conspn->app_heap_size =
|
||||
mem_inst->heap_data_end - mem_inst->heap_data;
|
||||
/* size of app heap structure */
|
||||
|
||||
Reference in New Issue
Block a user