analyzer: fix param "analyzer-max-enodes-per-program-point"
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 27 Oct 2020 13:50:24 +0000 (09:50 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 27 Oct 2020 13:50:24 +0000 (09:50 -0400)
This was effectively checking for one beyond the limit, rather than
the limit itself.

Seen when fixing PR analyzer/97514.

gcc/analyzer/ChangeLog:
* engine.cc (exploded_graph::get_or_create_node): Fix off-by-one
when imposing param_analyzer_max_enodes_per_program_point limit.

gcc/analyzer/engine.cc

index d4c654a34978ce93d952570315412b3522855986..be54f0256b7972581b9d482eb46058bf49dbf6be 100644 (file)
@@ -2100,7 +2100,7 @@ exploded_graph::get_or_create_node (const program_point &point,
   /* Impose a limit on the number of enodes per program point, and
      simply stop if we exceed it.  */
   if ((int)per_point_data->m_enodes.length ()
-      > param_analyzer_max_enodes_per_program_point)
+      >= param_analyzer_max_enodes_per_program_point)
     {
       pretty_printer pp;
       point.print (&pp, format (false));