analyzer: fixes to call_summary_replay::dump_to_pp
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 6 Oct 2022 19:46:20 +0000 (15:46 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 6 Oct 2022 19:46:20 +0000 (15:46 -0400)
gcc/analyzer/ChangeLog:
* call-summary.cc (call_summary_replay::dump_to_pp): Bulletproof
against NULL caller regions/svalues.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/call-summary.cc

index bc50562..12ef82d 100644 (file)
@@ -845,14 +845,20 @@ call_summary_replay::dump_to_pp (pretty_printer *pp, bool simple) const
   for (auto summary_reg : summary_regs)
     {
       pp_string (pp, "reg in summary: ");
-      summary_reg->dump_to_pp (pp, simple);
+      if (summary_reg)
+       summary_reg->dump_to_pp (pp, simple);
+      else
+       pp_string (pp, "(null)");
       pp_newline (pp);
 
       const region *caller_reg
        = *((const_cast<region_map_t &>
             (m_map_region_from_summary_to_caller)).get (summary_reg));
       pp_string (pp, " reg in caller: ");
-      caller_reg->dump_to_pp (pp, simple);
+      if (caller_reg)
+       caller_reg->dump_to_pp (pp, simple);
+      else
+       pp_string (pp, "(null)");
       pp_newline (pp);
     }
 }