diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-17 21:53:36 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-17 21:53:36 -0800 |
commit | 280936837010d75a9a8863e486e05e13b1ef964a (patch) | |
tree | c4733b354d043960ae40d587eb1c5c55f184cea0 /src | |
parent | a88651b6b9853c62fdc8e38948375fe894172298 (diff) | |
download | binaryen-280936837010d75a9a8863e486e05e13b1ef964a.tar.gz binaryen-280936837010d75a9a8863e486e05e13b1ef964a.tar.bz2 binaryen-280936837010d75a9a8863e486e05e13b1ef964a.zip |
add asserts
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-interpreter.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index fe84da315..99c3d6d88 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -306,6 +306,7 @@ private: Flow flow = visit(curr->value); if (flow.breaking()) return flow; NOTE_EVAL1(flow.value); + assert(flow.value.type == curr->type); scope.locals[name] = flow.value; return flow; } @@ -406,6 +407,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); if (left.type == i32) { int32_t l = left.geti32(), r = right.geti32(); switch (curr->op) { |