summaryrefslogtreecommitdiff
path: root/src/wasm-binary-reader.c
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2016-10-31 16:58:52 -0700
committerGitHub <noreply@github.com>2016-10-31 16:58:52 -0700
commitb284c48616fff555752b426f3792c0a24aad8ac1 (patch)
tree063fac8a849a6463537758536d9cc6692d459ed3 /src/wasm-binary-reader.c
parent5d6cd3e3a37c48327db5c67c5dc0cdf69f25973e (diff)
downloadwabt-b284c48616fff555752b426f3792c0a24aad8ac1.tar.gz
wabt-b284c48616fff555752b426f3792c0a24aad8ac1.tar.bz2
wabt-b284c48616fff555752b426f3792c0a24aad8ac1.zip
wasmdump improvments (#192)
* wasmdump improvments - Split into three different passes: headers, details, and raw - Nest imports correctly - Show element count as part of section header rather than on its own line
Diffstat (limited to 'src/wasm-binary-reader.c')
-rw-r--r--src/wasm-binary-reader.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-binary-reader.c b/src/wasm-binary-reader.c
index 21b2169d..950b6752 100644
--- a/src/wasm-binary-reader.c
+++ b/src/wasm-binary-reader.c
@@ -589,7 +589,7 @@ static void logging_on_error(WasmBinaryReaderContext* ctx,
FORWARD0(name); \
}
-LOGGING0(begin_module)
+LOGGING_UINT32(begin_module)
LOGGING0(end_module)
LOGGING_BEGIN(signature_section)
LOGGING_UINT32(on_signature_count)
@@ -1706,8 +1706,6 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
wasm_reserve_uint32s(allocator, &ctx->target_depths,
INITIAL_BR_TABLE_TARGET_CAPACITY);
- CALLBACK0(begin_module);
-
uint32_t magic;
in_u32(ctx, &magic, "magic");
RAISE_ERROR_UNLESS(magic == WASM_BINARY_MAGIC, "bad magic value");
@@ -1717,6 +1715,8 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
"bad wasm file version: %#x (expected %#x)", version,
WASM_BINARY_VERSION);
+ CALLBACK(begin_module, version);
+
/* type */
uint32_t section_size;
if (skip_until_section(ctx, WASM_BINARY_SECTION_TYPE, &section_size)) {