summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-02 10:30:06 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-03-02 10:30:06 -0800
commitaf8073f0d361ee232152e411b89f48c6309281c2 (patch)
treef75c06bbbbba7ee0f8ae0be3fec4a207c334dd1b /src/wasm-interpreter.h
parent91f6a135f9accf0dfcf1a47bb1da45635d1d943e (diff)
downloadbinaryen-af8073f0d361ee232152e411b89f48c6309281c2.tar.gz
binaryen-af8073f0d361ee232152e411b89f48c6309281c2.tar.bz2
binaryen-af8073f0d361ee232152e411b89f48c6309281c2.zip
fix assertion in interpreter that was too strong - we can have blocks with no return type, but that still end up returning a type due to a branch
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 2a841f6fd..a7405e948 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -29,6 +29,10 @@
#include "support/bits.h"
#include "wasm.h"
+#ifdef WASM_INTERPRETER_DEBUG
+#include "wasm-printing.h"
+#endif
+
namespace wasm {
using namespace cashew;
@@ -166,7 +170,7 @@ private:
indent++;
#if WASM_INTERPRETER_DEBUG == 2
doIndent(std::cout, indent);
- expression->print(std::cout, indent) << '\n';
+ std::cout << "\n" << expression << '\n';
indent++;
#endif
}
@@ -445,8 +449,8 @@ private:
if (flow.breaking()) return flow;
Literal right = flow.value;
NOTE_EVAL2(left, right);
- assert(left.type == curr->left->type);
- assert(right.type == curr->right->type);
+ assert(isConcreteWasmType(curr->left->type) ? left.type == curr->left->type : true);
+ assert(isConcreteWasmType(curr->right->type) ? right.type == curr->right->type : true);
if (left.type == i32) {
switch (curr->op) {
case Add: return left.add(right);