diff --git a/core/iwasm/aot/aot_loader.c b/core/iwasm/aot/aot_loader.c index 4abe950dc..e4fd3e0fc 100644 --- a/core/iwasm/aot/aot_loader.c +++ b/core/iwasm/aot/aot_loader.c @@ -3315,7 +3315,7 @@ aot_get_custom_section(const AOTModule *module, const char *name, uint32 *len) WASMCustomSection *section = module->custom_section_list; while (section) { - if (strcmp(section->name_addr, name)) { + if (strcmp(section->name_addr, name) == 0) { if (len) { *len = section->content_len; } diff --git a/core/iwasm/compilation/aot_emit_aot_file.c b/core/iwasm/compilation/aot_emit_aot_file.c index 65b9e1837..e6d070545 100644 --- a/core/iwasm/compilation/aot_emit_aot_file.c +++ b/core/iwasm/compilation/aot_emit_aot_file.c @@ -1942,7 +1942,6 @@ aot_emit_custom_sections(uint8 *buf, uint8 *buf_end, uint32 *p_offset, AOTCompData *comp_data, AOTCompContext *comp_ctx) { uint32 offset = *p_offset, i; - bool emitted = false; for (i = 0; i < comp_ctx->custom_sections_count; i++) { const char *section_name = comp_ctx->custom_sections_wp[i]; @@ -1956,11 +1955,6 @@ aot_emit_custom_sections(uint8 *buf, uint8 *buf_end, uint32 *p_offset, continue; } - if (!emitted) { - emitted = true; - *p_offset = offset = align_uint(offset, 4); - } - offset = align_uint(offset, 4); EMIT_U32(AOT_SECTION_TYPE_CUSTOM); /* sub section id + content */