Implement post-MVP features and native stack overflow check (#243)

Implement native thread stack overflow check
Implement post-MVP: Non-trapping float-to-int conversions
Implement post-MVP: Sign-extension operators
Enhance WASM loader checks
This commit is contained in:
wenyongh
2020-04-30 17:52:11 +08:00
committed by GitHub
parent ab4f0c5419
commit d381b0fdec
36 changed files with 1246 additions and 232 deletions

View File

@ -942,8 +942,7 @@ load_init_data_section(const uint8 *buf, const uint8 *buf_end,
/* check start function index */
if (module->start_func_index != (uint32)-1
&& (module->start_func_index < module->import_func_count
|| module->start_func_index >= module->import_func_count
&& (module->start_func_index >= module->import_func_count
+ module->func_count)) {
set_error_buf(error_buf, error_buf_size,
"AOT module load failed: "
@ -1044,9 +1043,13 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
/* Set start function when function pointers are resolved */
if (module->start_func_index != (uint32)-1) {
module->start_function =
module->func_ptrs[module->start_func_index
- module->import_func_count];
if (module->start_func_index >= module->import_func_count)
module->start_function =
module->func_ptrs[module->start_func_index
- module->import_func_count];
else
/* TODO: fix start function can be import function issue */
module->start_function = NULL;
}
else {
module->start_function = NULL;