From 6c52601dde6699e0655c9a61dc2df3089e0a0204 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 29 Jan 2016 17:00:40 -0800 Subject: fix I8Const usage --- src/wasm-binary.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wasm-binary.h') 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; -- cgit v1.2.3