From d6e8b0263c43d2681ecbbbfc18cb8769d8333df9 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 3 Sep 2013 21:40:43 -0400 Subject: [PATCH] Fix crash on 32-bit Ubuntu, bug670. --- Changes | 2 ++ src/V3Ast.cpp | 8 ++++++++ src/V3Ast.h | 2 ++ src/V3LinkLevel.cpp | 1 + 4 files changed, 13 insertions(+) diff --git a/Changes b/Changes index 84efbc4ec..9b61e995c 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix --output-split-cfunc to count internal functions. [Chris Randall] +**** Fix crash on 32-bit Ubuntu, bug670. [Mark Jackson Pulver] + * Verilator 3.851 2013-08-15 diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index d0f1a3110..0f5f73946 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -965,6 +965,14 @@ void AstNode::dumpTreeFileGdb(const char* filenamep) { // For GDB only v3Global.rootp()->dumpTreeFile(filename); } +void AstNode::checkIter() const { + if (m_iterpp) { + dumpPtrs(cout); + // Perhaps something forgot to clear m_iterpp? + this->v3fatalSrc("Iteration link should be NULL"); + } +} + void AstNode::dumpPtrs(ostream& os) const { os<<"This="<clearIter(); // Because we didn't iterate to find the node pointers, may have a stale m_iterp() needing cleanup nodep->unlinkFrBack(); } if (v3Global.rootp()->modulesp()) v3Global.rootp()->v3fatalSrc("Unlink didn't work");