diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-02-10 18:10:47 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-02-10 21:11:46 -0800 |
commit | 7b778798f1bbecfd95ff65ea94317957e79b9ee7 (patch) | |
tree | 3f74ec52168a03bef0ed245c7ffa124631905b7e /src | |
parent | 67c4675514ec9c220a74274f6fea10a47c7d5bac (diff) | |
download | binaryen-7b778798f1bbecfd95ff65ea94317957e79b9ee7.tar.gz binaryen-7b778798f1bbecfd95ff65ea94317957e79b9ee7.tar.bz2 binaryen-7b778798f1bbecfd95ff65ea94317957e79b9ee7.zip |
fix s2wasm store parsing
Diffstat (limited to 'src')
-rw-r--r-- | src/s2wasm.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index ac62046d8..5557cc2ff 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -21,6 +21,8 @@ #ifndef wasm_s2wasm_h #define wasm_s2wasm_h +#include <limits.h> + #include "wasm.h" #include "parsing.h" #include "asm_v_wasm.h" @@ -649,7 +651,7 @@ class S2WasmBuilder { skipComma(); auto curr = allocator.alloc<Load>(); curr->type = type; - int32_t bytes = getInt()/8; + int32_t bytes = getInt() / CHAR_BIT; curr->bytes = bytes > 0 ? bytes : getWasmTypeSize(type); curr->signed_ = match("_s"); match("_u"); @@ -669,7 +671,7 @@ class S2WasmBuilder { skipComma(); auto curr = allocator.alloc<Store>(); curr->type = type; - int32_t bytes = getInt(); + int32_t bytes = getInt() / CHAR_BIT; curr->bytes = bytes > 0 ? bytes : getWasmTypeSize(type); Name assign = getAssign(); getConst(&curr->offset); |