Fix wasm loader check data segment count (#4039)
correctly report error when datacount section has non-zero data segment count while the data section is not present
This commit is contained in:
@ -2734,6 +2734,11 @@ load_from_sections(WASMModule *module, WASMSection *sections,
|
||||
section = section->next;
|
||||
}
|
||||
|
||||
#if WASM_ENABLE_BULK_MEMORY != 0
|
||||
bh_assert(!has_datacount_section
|
||||
|| module->data_seg_count == module->data_seg_count1);
|
||||
#endif
|
||||
|
||||
module->aux_data_end_global_index = (uint32)-1;
|
||||
module->aux_heap_base_global_index = (uint32)-1;
|
||||
module->aux_stack_top_global_index = (uint32)-1;
|
||||
|
||||
Reference in New Issue
Block a user