summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-29 17:00:40 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-29 17:00:40 -0800
commit6c52601dde6699e0655c9a61dc2df3089e0a0204 (patch)
treecaa27655b7324ea470eec50fc5e5fee208a90b38 /src/wasm-binary.h
parentfd0488f48cd2561aacb0f2eb02df6e9524dc9b62 (diff)
downloadbinaryen-6c52601dde6699e0655c9a61dc2df3089e0a0204.tar.gz
binaryen-6c52601dde6699e0655c9a61dc2df3089e0a0204.tar.bz2
binaryen-6c52601dde6699e0655c9a61dc2df3089e0a0204.zip
fix I8Const usage
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 9db23d25d..757551c12 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -776,9 +776,9 @@ public:
if (debug) std::cerr << "zz node: Const" << std::endl;
switch (curr->type) {
case i32: {
- int32_t value = curr->value.i32;
- if (value >= -128 && value <= 127) {
- o << int8_t(BinaryConsts::I8Const) << int8_t(value);
+ uint32_t value = curr->value.i32;
+ if (value <= 255) {
+ o << int8_t(BinaryConsts::I8Const) << uint8_t(value);
break;
}
o << int8_t(BinaryConsts::I32Const) << value;