Error message improvement (#4000)

Improve error message in the scenario where the runtime was built
with ref types disabled but the module uses reference types feature.
This commit is contained in:
Marcin Kolny 2025-01-03 02:44:25 +00:00 committed by GitHub
parent 7f3e0df21c
commit 31ff576edf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 WASM_ENABLE_REF_TYPES == 0 && WASM_ENABLE_GC == 0
if (table_index != 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; return false;
} }
#endif #endif