Fix app heap corrupted unchecked issue (#788)
Check whether app heap is corrupted in gc_migrate() and gci_dump(), and handle the failures in wasm/aot_enlarge_memory().
This commit is contained in:
@ -4211,3 +4211,14 @@ fail:
|
||||
wasm_runtime_free(results);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
wasm_runtime_show_app_heap_corrupted_prompt()
|
||||
{
|
||||
LOG_ERROR("Error: app heap is corrupted, if the wasm file "
|
||||
"is compiled by wasi-sdk-12.0 or higher version, "
|
||||
"please add -Wl,--export=malloc -Wl,--export=free "
|
||||
"to export malloc and free functions. If it is "
|
||||
"compiled by asc, please add --exportRuntime to "
|
||||
"export the runtime helpers.");
|
||||
}
|
||||
|
||||
@ -839,6 +839,9 @@ wasm_runtime_invoke_c_api_native(WASMModuleInstanceCommon *module_inst,
|
||||
uint32 argc, uint32 *argv, bool with_env,
|
||||
void *wasm_c_api_env);
|
||||
|
||||
void
|
||||
wasm_runtime_show_app_heap_corrupted_prompt();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user