From f7a5883205ba24f5cdde528bb3939ca80280ae1c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 13 Nov 2020 21:12:03 -0500 Subject: [PATCH] Internals: assert not double adding. No functional change intended. --- src/V3Ast.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index f1b146440..f7bf4eccd 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -394,6 +394,7 @@ void AstNode::setOp4p(AstNode* newp) { void AstNode::addOp1p(AstNode* newp) { UASSERT(newp, "Null item passed to addOp1p"); + UDEBUGONLY(UASSERT_OBJ(!newp->m_backp, newp, "Adding already linked node");); if (!m_op1p) { op1p(newp); } else { @@ -403,6 +404,7 @@ void AstNode::addOp1p(AstNode* newp) { void AstNode::addOp2p(AstNode* newp) { UASSERT(newp, "Null item passed to addOp2p"); + UDEBUGONLY(UASSERT_OBJ(!newp->m_backp, newp, "Adding already linked node");); if (!m_op2p) { op2p(newp); } else { @@ -412,6 +414,7 @@ void AstNode::addOp2p(AstNode* newp) { void AstNode::addOp3p(AstNode* newp) { UASSERT(newp, "Null item passed to addOp3p"); + UDEBUGONLY(UASSERT_OBJ(!newp->m_backp, newp, "Adding already linked node");); if (!m_op3p) { op3p(newp); } else { @@ -421,6 +424,7 @@ void AstNode::addOp3p(AstNode* newp) { void AstNode::addOp4p(AstNode* newp) { UASSERT(newp, "Null item passed to addOp4p"); + UDEBUGONLY(UASSERT_OBJ(!newp->m_backp, newp, "Adding already linked node");); if (!m_op4p) { op4p(newp); } else {