summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}
}