summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-01 11:38:05 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-01 11:38:05 -0800
commit904aba781d4cdd7074d2f8d4faa833207a31e83e (patch)
tree5cd84ba9772c24fcbf57ec7b8e083d66f0e8a572 /src/wasm-interpreter.h
parentf8ca2533c9c3a389375e4f6b4b78f09eb6dee30c (diff)
downloadbinaryen-904aba781d4cdd7074d2f8d4faa833207a31e83e.tar.gz
binaryen-904aba781d4cdd7074d2f8d4faa833207a31e83e.tar.bz2
binaryen-904aba781d4cdd7074d2f8d4faa833207a31e83e.zip
fix execution of compare on floats
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 70c33a6b0..7356c6b64 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -259,8 +259,8 @@ public:
if (flow.breaking()) return flow;
Literal right = flow.value;
switch (curr->op) { // :)
- case Eq: return curr->type == i32 ? Flow(Literal(left.geti32() == right.geti32())) : Flow(Literal(left.getf64() == right.getf64()));
- case Ne: return curr->type == i32 ? Flow(Literal(left.geti32() != right.geti32())) : Flow(Literal(left.getf64() != right.getf64()));
+ case Eq: return curr->left->type == i32 ? Flow(Literal(left.geti32() == right.geti32())) : Flow(Literal(left.getf64() == right.getf64()));
+ case Ne: return curr->left->type == i32 ? Flow(Literal(left.geti32() != right.geti32())) : Flow(Literal(left.getf64() != right.getf64()));
case LtS: return Flow(Literal(left.geti32() < right.geti32()));
case LtU: return Flow(Literal(uint32_t(left.geti32()) < uint32_t(right.geti32())));
case LeS: return Flow(Literal(left.geti32() <= right.geti32()));