From 17338710275948c23e0f0b312d004b84976f68bc Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 14 Dec 2018 12:33:37 +0100 Subject: Bug 793076 - Segmentation fault when generating graphical class hierarchy Prevent endless loop during renumbering --- src/dot.cpp | 7 ++++++- src/dot.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dot.cpp b/src/dot.cpp index 0d8502d..0944a02 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -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) { } @@ -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); + } } } } diff --git a/src/dot.h b/src/dot.h index 20a1f29..dc77789 100644 --- a/src/dot.h +++ b/src/dot.h @@ -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; -- cgit v0.12