summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2016-10-31 13:42:45 -0700
committerGitHub <noreply@github.com>2016-10-31 13:42:45 -0700
commit5d6cd3e3a37c48327db5c67c5dc0cdf69f25973e (patch)
tree1020ab0b3fdb541d6c60cd52dacafc7384b24714 /src
parent2baa1ecb0b36bea6268c52ea49246aafbed05f02 (diff)
downloadwabt-5d6cd3e3a37c48327db5c67c5dc0cdf69f25973e.tar.gz
wabt-5d6cd3e3a37c48327db5c67c5dc0cdf69f25973e.tar.bz2
wabt-5d6cd3e3a37c48327db5c67c5dc0cdf69f25973e.zip
Convert WasmType into an enum (#197)
Fix the bug in logging_begin_global that was exposed by the using an explicit type here.
Diffstat (limited to 'src')
-rw-r--r--src/wasm-binary-reader.c2
-rw-r--r--src/wasm-common.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/wasm-binary-reader.c b/src/wasm-binary-reader.c
index fa3fec86..21b2169d 100644
--- a/src/wasm-binary-reader.c
+++ b/src/wasm-binary-reader.c
@@ -783,7 +783,7 @@ static WasmResult logging_begin_global(uint32_t index,
LoggingContext* ctx = user_data;
LOGF("begin_global(index: %u, type: %s, mutable: %s)\n", index,
wasm_get_type_name(type), mutable_ ? "true" : "false");
- FORWARD(begin_global, index, mutable_, type);
+ FORWARD(begin_global, index, type, mutable_);
}
static WasmResult logging_on_export(uint32_t index,
diff --git a/src/wasm-common.h b/src/wasm-common.h
index f1be4686..99ebd8f2 100644
--- a/src/wasm-common.h
+++ b/src/wasm-common.h
@@ -128,7 +128,7 @@ typedef struct WasmBinaryErrorHandler {
{ wasm_default_binary_error_callback, NULL }
/* matches binary format, do not change */
-enum {
+typedef enum WasmType {
WASM_TYPE_I32 = -0x01,
WASM_TYPE_I64 = -0x02,
WASM_TYPE_F32 = -0x03,
@@ -138,8 +138,7 @@ enum {
WASM_TYPE_VOID = -0x40,
WASM_TYPE____ = WASM_TYPE_VOID, /* convenient for the opcode table below */
WASM_TYPE_ANY = 0, /* Not actually specified, but useful for type-checking */
-};
-typedef int32_t WasmType;
+} WasmType;
/* matches binary format, do not change */
typedef enum WasmExternalKind {