From b0f1ff9ecb645ab81657849a8939addaee36e4a4 Mon Sep 17 00:00:00 2001 From: Marcin Kolny Date: Thu, 2 Jan 2025 11:50:50 +0000 Subject: [PATCH] Error message improvement Improve error message in the scenario where the runtime was built with ref types disabled but the module uses reference types feature. --- core/iwasm/interpreter/wasm_loader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index 79ed996d87..91237c0075 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -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