Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -5926,6 +5926,15 @@ load_from_sections(WASMModule *module, WASMSection *sections,
section = section->next;
}

#if WASM_ENABLE_BULK_MEMORY != 0
if (has_datacount_section
&& module->data_seg_count != module->data_seg_count1) {
set_error_buf(error_buf, error_buf_size,
"data count and data section have inconsistent lengths");
return false;
}
#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;
Expand Down
5 changes: 5 additions & 0 deletions core/iwasm/interpreter/wasm_mini_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading