From b4574123c9d5f41c58f63237b204414362d85b79 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 19 Apr 2022 09:57:44 +0900 Subject: [PATCH] aot_get_module_mem_consumption: Fix const strings size (#1098) Fix the issue that the `*(uint32 *)p_const_string_size` is added repeatedly while calculating the aot module's memory consumption. --- core/iwasm/aot/aot_runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/iwasm/aot/aot_runtime.c b/core/iwasm/aot/aot_runtime.c index 19120b45..13e276fb 100644 --- a/core/iwasm/aot/aot_runtime.c +++ b/core/iwasm/aot/aot_runtime.c @@ -2614,7 +2614,7 @@ aot_get_aux_stack(WASMExecEnv *exec_env, uint32 *start_offset, uint32 *size) static void const_string_node_size_cb(void *key, void *value, void *p_const_string_size) { - uint32 const_string_size = *(uint32 *)p_const_string_size; + uint32 const_string_size = 0; const_string_size += bh_hash_map_get_elem_struct_size(); const_string_size += strlen((const char *)value) + 1; *(uint32 *)p_const_string_size += const_string_size;