From: Matthew Fernandez Date: Sat, 31 Oct 2020 23:01:31 +0000 (-0700) Subject: introduce an assertion on rank consistency X-Git-Tag: 2.46.0~18^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b2088fe3a2e6ba3f1d039f47307622c42d29b89;p=graphviz introduce an assertion on rank consistency Related to #1221. --- diff --git a/lib/dotgen/cluster.c b/lib/dotgen/cluster.c index c711f1b76..892ac092c 100644 --- a/lib/dotgen/cluster.c +++ b/lib/dotgen/cluster.c @@ -11,7 +11,7 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ - +#include #include static node_t* @@ -233,6 +233,8 @@ merge_ranks(graph_t * subg) node_t *v; graph_t *root; + assert(GD_minrank(subg) <= GD_maxrank(subg) && "corrupted rank bounds"); + root = dot_root(subg); if (GD_minrank(subg) > 0) GD_rank(root)[GD_minrank(subg) - 1].valid = FALSE;