Drop declarative elements on module instantiation (#3922)

This commit is contained in:
James Ring 2024-11-23 19:30:00 -08:00 committed by GitHub
parent 62aca17279
commit 00c2aa10a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -1905,7 +1905,9 @@ aot_instantiate(AOTModule *module, AOTModuleInstance *parent,
goto fail; goto fail;
} }
for (i = 0; i < module->table_init_data_count; i++) { for (i = 0; i < module->table_init_data_count; i++) {
if (wasm_elem_is_active(module->table_init_data_list[i]->mode)) if (wasm_elem_is_active(module->table_init_data_list[i]->mode)
|| wasm_elem_is_declarative(
module->table_init_data_list[i]->mode))
bh_bitmap_set_bit(common->elem_dropped, i); bh_bitmap_set_bit(common->elem_dropped, i);
} }
} }

View File

@ -2467,7 +2467,8 @@ wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
goto fail; goto fail;
} }
for (i = 0; i < module->table_seg_count; i++) { for (i = 0; i < module->table_seg_count; i++) {
if (wasm_elem_is_active(module->table_segments[i].mode)) if (wasm_elem_is_active(module->table_segments[i].mode)
|| wasm_elem_is_declarative(module->table_segments[i].mode))
bh_bitmap_set_bit(module_inst->e->common.elem_dropped, i); bh_bitmap_set_bit(module_inst->e->common.elem_dropped, i);
} }
} }