From f9164ab0d2726064f9df7a1b052f59b6a0953d2e Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 25 Jun 2023 07:40:00 -0400 Subject: [PATCH] Internals: Assert dtype comparison. No functional change intended. --- src/V3Ast.cpp | 3 +++ 1 file changed, 3 insertions(+) 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)