diff options
-rw-r--r-- | src/binary-reader.c | 2 | ||||
-rw-r--r-- | test/binary/bad-function-names-too-many.txt | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/binary-reader.c b/src/binary-reader.c index 6ef162ac..7095403e 100644 --- a/src/binary-reader.c +++ b/src/binary-reader.c @@ -1653,8 +1653,6 @@ static void read_custom_section(Context* ctx, uint32_t section_size) { CALLBACK_SECTION(begin_names_section, section_size); uint32_t i, num_functions; in_u32_leb128(ctx, &num_functions, "function name count"); - RAISE_ERROR_UNLESS(num_functions <= num_total_funcs(ctx), - "function name count > function signature count"); CALLBACK(on_function_names_count, num_functions); for (i = 0; i < num_functions; ++i) { WasmStringSlice function_name; diff --git a/test/binary/bad-function-names-too-many.txt b/test/binary/bad-function-names-too-many.txt index 9c08de1e..f5f50f2a 100644 --- a/test/binary/bad-function-names-too-many.txt +++ b/test/binary/bad-function-names-too-many.txt @@ -12,6 +12,7 @@ section("name") { } (;; STDERR ;;; Error running "wasm2wast": -error: @0x00000021: function name count > function signature count +error: expected function name count (2) <= function count (1) +error: @0x00000021: on_function_names_count callback failed ;;; STDERR ;;) |