Skip to content

Commit

Permalink
Bug 793076 - Segmentation fault when generating graphical class hiera…
Browse files Browse the repository at this point in the history
…rchy

Prevent endless loop during renumbering
  • Loading branch information
albert-github committed Dec 14, 2018
1 parent ca2e7ae commit 1733871
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ DotNode::DotNode(int n,const char *lab,const char *tip, const char *url,
, m_visible(FALSE)
, m_truncated(Unknown)
, m_distance(1000)
, m_renumbered(false)
{
}

Expand Down Expand Up @@ -2287,7 +2288,11 @@ void DotNode::renumberNodes(int &number)
DotNode *cn;
for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
{
cn->renumberNodes(number);
if (!cn->m_renumbered)
{
cn->m_renumbered = true;
cn->renumberNodes(number);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/dot.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class DotNode
bool m_visible; //!< is the node visible in the output
TruncState m_truncated; //!< does the node have non-visible children/parents
int m_distance; //!< shortest path to the root node
bool m_renumbered;//!< indicates if the node has been renumbered (to prevent endless loops)

friend class DotGfxHierarchyTable;
friend class DotClassGraph;
Expand Down

0 comments on commit 1733871

Please sign in to comment.