mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 16:58:34 +00:00
address PR comments
This commit is contained in:
parent
79c4fd9a1e
commit
c6a5600880
|
@ -3315,7 +3315,7 @@ aot_get_custom_section(const AOTModule *module, const char *name, uint32 *len)
|
||||||
WASMCustomSection *section = module->custom_section_list;
|
WASMCustomSection *section = module->custom_section_list;
|
||||||
|
|
||||||
while (section) {
|
while (section) {
|
||||||
if (strcmp(section->name_addr, name)) {
|
if (strcmp(section->name_addr, name) == 0) {
|
||||||
if (len) {
|
if (len) {
|
||||||
*len = section->content_len;
|
*len = section->content_len;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1942,7 +1942,6 @@ aot_emit_custom_sections(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
||||||
AOTCompData *comp_data, AOTCompContext *comp_ctx)
|
AOTCompData *comp_data, AOTCompContext *comp_ctx)
|
||||||
{
|
{
|
||||||
uint32 offset = *p_offset, i;
|
uint32 offset = *p_offset, i;
|
||||||
bool emitted = false;
|
|
||||||
|
|
||||||
for (i = 0; i < comp_ctx->custom_sections_count; i++) {
|
for (i = 0; i < comp_ctx->custom_sections_count; i++) {
|
||||||
const char *section_name = comp_ctx->custom_sections_wp[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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!emitted) {
|
|
||||||
emitted = true;
|
|
||||||
*p_offset = offset = align_uint(offset, 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
offset = align_uint(offset, 4);
|
offset = align_uint(offset, 4);
|
||||||
EMIT_U32(AOT_SECTION_TYPE_CUSTOM);
|
EMIT_U32(AOT_SECTION_TYPE_CUSTOM);
|
||||||
/* sub section id + content */
|
/* sub section id + content */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user