Skip to content

Commit

Permalink
cr suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
TianlongLiang committed Oct 11, 2024
1 parent 6b8fc70 commit 2ff60a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions core/iwasm/common/wasm_loader_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ wasm_table_check_flags(const uint8 table_flag, char *error_buf,
}
#if WASM_ENABLE_MEMORY64 == 0
if (table_flag & TABLE64_FLAG) {
LOG_VERBOSE("table64 flag was found, please enable memory64");
wasm_loader_set_error_buf(error_buf, error_buf_size,
"invalid limits flags", is_aot);
"invalid limits flags(table64 flag was found, please enable memory64)", is_aot);
return false;
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/compilation/aot_compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ aot_validate_wasm(AOTCompContext *comp_ctx)
if (comp_ctx->pointer_size < sizeof(uint64)) {
if (IS_MEMORY64) {
aot_set_last_error(
"Compiling wasm64 to 32bit platform is not allowed");
"Compiling wasm64(contains i64 memory section) to 32bit platform is not allowed");
return false;
}

for (uint32 i = 0; i < comp_ctx->comp_data->table_count; ++i) {
if (IS_TABLE64(i)) {
aot_set_last_error(
"Compiling wasm64 to 32bit platform is not allowed");
"Compiling wasm64(contains i64 table section) to 32bit platform is not allowed");
return false;
}
}
Expand Down
6 changes: 2 additions & 4 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2569,8 +2569,7 @@ load_table_import(const uint8 **p_buf, const uint8 *buf_end,
read_leb_uint32(p, p_end, table_flag);
is_table64 = table_flag & TABLE64_FLAG;
if (p - p_org > 1) {
LOG_VERBOSE("integer representation too long");
set_error_buf(error_buf, error_buf_size, "invalid limits flags");
set_error_buf(error_buf, error_buf_size, "invalid table limits flags(integer representation too long)");
return false;
}

Expand Down Expand Up @@ -3092,8 +3091,7 @@ load_table(const uint8 **p_buf, const uint8 *buf_end, WASMModule *module,
read_leb_uint32(p, p_end, table->table_type.flags);
is_table64 = table->table_type.flags & TABLE64_FLAG;
if (p - p_org > 1) {
LOG_VERBOSE("integer representation too long");
set_error_buf(error_buf, error_buf_size, "invalid limits flags");
set_error_buf(error_buf, error_buf_size, "invalid table limits flags(integer representation too long)");
return false;
}

Expand Down

0 comments on commit 2ff60a9

Please sign in to comment.