diff options
author | Sam Clegg <sbc@chromium.org> | 2017-05-10 10:59:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-10 10:59:21 -0700 |
commit | b040dc4b5edae9974343f0dcf73284802274a54f (patch) | |
tree | 3f589d02f9c78c0d7cb5e90cbbd6b631448cc856 /src/binary-reader.cc | |
parent | 47407e7f11a7cc4568b2901bf2dd36b8ebf91cec (diff) | |
download | wabt-b040dc4b5edae9974343f0dcf73284802274a54f.tar.gz wabt-b040dc4b5edae9974343f0dcf73284802274a54f.tar.bz2 wabt-b040dc4b5edae9974343f0dcf73284802274a54f.zip |
Improve error messages in binary reader (#421)
Diffstat (limited to 'src/binary-reader.cc')
-rw-r--r-- | src/binary-reader.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc index 435d4d5d..67567173 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -1213,7 +1213,7 @@ static void read_export_section(Context* ctx, uint32_t section_size) { uint8_t external_kind; in_u8(ctx, &external_kind, "export external kind"); RAISE_ERROR_UNLESS(is_valid_external_kind(external_kind), - "invalid export external kind"); + "invalid export external kind: %d", external_kind); uint32_t item_index; in_u32_leb128(ctx, &item_index, "export item index"); @@ -1224,15 +1224,15 @@ static void read_export_section(Context* ctx, uint32_t section_size) { break; case ExternalKind::Table: RAISE_ERROR_UNLESS(item_index < num_total_tables(ctx), - "invalid export table index"); + "invalid export table index: %d", item_index); break; case ExternalKind::Memory: RAISE_ERROR_UNLESS(item_index < num_total_memories(ctx), - "invalid export memory index"); + "invalid export memory index: %d", item_index); break; case ExternalKind::Global: RAISE_ERROR_UNLESS(item_index < num_total_globals(ctx), - "invalid export global index"); + "invalid export global index: %d", item_index); break; } @@ -1247,7 +1247,7 @@ static void read_start_section(Context* ctx, uint32_t section_size) { uint32_t func_index; in_u32_leb128(ctx, &func_index, "start function index"); RAISE_ERROR_UNLESS(func_index < num_total_funcs(ctx), - "invalid start function index"); + "invalid start function index: %d", func_index); CALLBACK(OnStartFunction, func_index); CALLBACK0(EndStartSection); } |