Skip to content

Commit

Permalink
Clear compilation warning and dead code (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyongh authored Jan 13, 2024
1 parent 63012f0 commit 23d2e06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions core/iwasm/compilation/aot_emit_aot_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
} \
} while (0)

#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
static bool
check_utf8_str(const uint8 *str, uint32 len)
{
Expand Down Expand Up @@ -89,6 +90,7 @@ check_utf8_str(const uint8 *str, uint32 len)
}
return (p == p_end);
}
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION != 0 */

/* Internal function in object file */
typedef struct AOTObjectFunc {
Expand Down Expand Up @@ -1111,6 +1113,7 @@ static union {
EMIT_BUF(s, str_len); \
} while (0)

#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
static bool
read_leb(uint8 **p_buf, const uint8 *buf_end, uint32 maxbits, bool sign,
uint64 *p_result)
Expand Down Expand Up @@ -1309,6 +1312,7 @@ get_name_section_size(AOTCompData *comp_data)
fail:
return 0;
}
#endif /* end of WASM_ENABLE_LOAD_CUSTOM_SECTION != 0 */

static uint32
get_custom_sections_size(AOTCompContext *comp_ctx, AOTCompData *comp_data)
Expand Down Expand Up @@ -2065,6 +2069,7 @@ aot_emit_native_symbol(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
return true;
}

#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
static bool
aot_emit_name_section(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
AOTCompData *comp_data, AOTCompContext *comp_ctx)
Expand All @@ -2090,6 +2095,7 @@ aot_emit_name_section(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
LOG_DEBUG("emit name section");
return true;
}
#endif

static bool
aot_emit_custom_sections(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
Expand Down
9 changes: 0 additions & 9 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4046,15 +4046,6 @@ check_wasi_abi_compatibility(const WASMModule *module,
* according to the assumption, they should be all wasi compatiable
*/

/* always can not have both at the same time */
if (start && initialize) {
set_error_buf(
error_buf, error_buf_size,
"neither a command nor a reactor can both have _start function "
"and _initialize function at the same time");
return false;
}

#if WASM_ENABLE_MULTI_MODULE != 0
/* filter out commands (with `_start`) cases */
if (start && !main_module) {
Expand Down

0 comments on commit 23d2e06

Please sign in to comment.