summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-27 13:26:18 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-27 13:48:31 -0800
commit79e05f5d713b90f50ece22dfc6410f065de78be7 (patch)
tree000270d59405c7618d54a65426eb6f817bf81836 /src/wasm.h
parent691e179fe4fc0d7349e7066e2a14f080f9488ca9 (diff)
downloadbinaryen-79e05f5d713b90f50ece22dfc6410f065de78be7.tar.gz
binaryen-79e05f5d713b90f50ece22dfc6410f065de78be7.tar.bz2
binaryen-79e05f5d713b90f50ece22dfc6410f065de78be7.zip
improve assert
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 7c6ff85e7..94c3cbdaa 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -269,6 +269,12 @@ enum HostOp {
PageSize, MemorySize, GrowMemory, HasFeature
};
+#define assert_node(condition, node) \
+ if (!condition) { \
+ std::cerr << "node: " << node << std::endl; \
+ assert(0 && #condition); \
+ }
+
//
// Expressions
//
@@ -824,7 +830,7 @@ public:
if (isRelational()) {
type = i32;
} else {
- assert(left->type == right->type);
+ assert_node(left->type == right->type, this);
type = left->type;
}
}