diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 2f2d57e30..d1183bc30 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -1083,6 +1083,9 @@ bool AstNode::sameTreeIter(const AstNode* node1p, const AstNode* node2p, bool ig if (!node1p || !node2p) return false; if (node1p->type() != node2p->type()) return false; if (node1p->dtypep() != node2p->dtypep()) return false; + UASSERT_OBJ( + (!node1p->dtypep() && !node2p->dtypep()) || (node1p->dtypep() && node2p->dtypep()), node1p, + "Comparison of a node with dtypep() with a node without dtypep()\n-node2=" << node2p); if (!node1p->same(node2p) || (gateOnly && !node1p->isGateOptimizable())) return false; return (sameTreeIter(node1p->m_op1p, node2p->m_op1p, false, gateOnly) && sameTreeIter(node1p->m_op2p, node2p->m_op2p, false, gateOnly)