Skip to content

Commit

Permalink
Error message improvement (#4000)
Browse files Browse the repository at this point in the history
Improve error message in the scenario where the runtime was built
with ref types disabled but the module uses reference types feature.
  • Loading branch information
loganek authored Jan 3, 2025
1 parent 7f3e0df commit 31ff576
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4237,7 +4237,10 @@ check_table_index(const WASMModule *module, uint32 table_index, char *error_buf,
{
#if WASM_ENABLE_REF_TYPES == 0 && WASM_ENABLE_GC == 0
if (table_index != 0) {
set_error_buf(error_buf, error_buf_size, "zero byte expected");
set_error_buf(
error_buf, error_buf_size,
"zero byte expected. The module uses reference types feature "
"which is disabled in the runtime.");
return false;
}
#endif
Expand Down

0 comments on commit 31ff576

Please sign in to comment.