diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-10-31 22:19:35 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-10-31 22:19:35 -0700 |
commit | b44b5f10b462f70a220a2b5ff435455419d39077 (patch) | |
tree | 1408a7831234882c04edd6ab22aa3914d30420f8 | |
parent | 3e87906af10d70e158a5ce34aac72baf35ace9d6 (diff) | |
download | binaryen-b44b5f10b462f70a220a2b5ff435455419d39077.tar.gz binaryen-b44b5f10b462f70a220a2b5ff435455419d39077.tar.bz2 binaryen-b44b5f10b462f70a220a2b5ff435455419d39077.zip |
int fixes
-rw-r--r-- | src/wasm-interpreter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 4733f5b90..70c33a6b0 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -233,10 +233,10 @@ public: case Add: return curr->type == i32 ? Flow(Literal(left.geti32() + right.geti32())) : Flow(Literal(left.getf64() + right.getf64())); case Sub: return curr->type == i32 ? Flow(Literal(left.geti32() - right.geti32())) : Flow(Literal(left.getf64() - right.getf64())); case Mul: return curr->type == i32 ? Flow(Literal(left.geti32() * right.geti32())) : Flow(Literal(left.getf64() * right.getf64())); - case DivS: return Flow(Literal(left.geti32() + right.geti32())); - case DivU: return Flow(Literal(int32_t(uint32_t(left.geti32()) + uint32_t(right.geti32())))); + case DivS: return Flow(Literal(left.geti32() / right.geti32())); + case DivU: return Flow(Literal(int32_t(uint32_t(left.geti32()) / uint32_t(right.geti32())))); case RemS: return Flow(Literal(left.geti32() % right.geti32())); - case RemU: return Flow(Literal(int32_t(uint32_t(left.geti32()) + uint32_t(right.geti32())))); + case RemU: return Flow(Literal(int32_t(uint32_t(left.geti32()) % uint32_t(right.geti32())))); case And: return Flow(Literal(left.geti32() & right.geti32())); case Or: return Flow(Literal(left.geti32() | right.geti32())); case Xor: return Flow(Literal(left.geti32() ^ right.geti32())); |