fix build error when enable custom section without interpreter

This commit is contained in:
Xu Jun 2022-06-15 17:10:36 +08:00
parent 1705ae569b
commit 5f3397591f
5 changed files with 19 additions and 18 deletions

View File

@ -14,7 +14,7 @@
#include "../compilation/aot_llvm.h" #include "../compilation/aot_llvm.h"
#endif #endif
#if (WASM_ENABLE_JIT != 0) || (WASM_ENABLE_LOAD_CUSTOM_SECTION != 0) #if (WASM_ENABLE_JIT != 0)
#include "../interpreter/wasm_loader.h" #include "../interpreter/wasm_loader.h"
#endif #endif

View File

@ -4905,3 +4905,16 @@ wasm_runtime_show_app_heap_corrupted_prompt()
"compiled by asc, please add --exportRuntime to " "compiled by asc, please add --exportRuntime to "
"export the runtime helpers."); "export the runtime helpers.");
} }
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
void
wasm_loader_destroy_custom_sections(WASMCustomSection *section_list)
{
WASMCustomSection *section = section_list, *next;
while (section) {
next = section->next;
wasm_runtime_free(section);
section = next;
}
}
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION */

View File

@ -884,6 +884,11 @@ wasm_runtime_invoke_c_api_native(WASMModuleInstanceCommon *module_inst,
void void
wasm_runtime_show_app_heap_corrupted_prompt(); wasm_runtime_show_app_heap_corrupted_prompt();
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
void
wasm_loader_destroy_custom_sections(WASMCustomSection *section_list);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -6504,18 +6504,6 @@ wasm_loader_get_custom_section(WASMModule *module, const char *name,
return false; return false;
} }
void
wasm_loader_destroy_custom_sections(WASMCustomSection *section_list)
{
WASMCustomSection *section = section_list, *next;
while (section) {
next = section->next;
wasm_runtime_free(section);
section = next;
}
}
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION */
static bool static bool
wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func, wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
uint32 cur_func_idx, char *error_buf, uint32 cur_func_idx, char *error_buf,

View File

@ -73,11 +73,6 @@ wasm_loader_find_block_addr(WASMExecEnv *exec_env, BlockAddr *block_addr_cache,
uint8 block_type, uint8 **p_else_addr, uint8 block_type, uint8 **p_else_addr,
uint8 **p_end_addr); uint8 **p_end_addr);
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
void
wasm_loader_destroy_custom_sections(WASMCustomSection *section_list);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif