From c6a5600880c918ff1c804b2754209f349f35a80f Mon Sep 17 00:00:00 2001 From: Xu Jun <693788454@qq.com> Date: Fri, 10 Jun 2022 20:51:24 +0800 Subject: [PATCH] address PR comments --- core/iwasm/aot/aot_loader.c | 2 +- core/iwasm/compilation/aot_emit_aot_file.c | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) 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 */