From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [committed] analyzer: fixes to call_summary_replay::dump_to_pp
Date: Thu, 6 Oct 2022 15:50:38 -0400 [thread overview]
Message-ID: <20221006195038.807580-1-dmalcolm@redhat.com> (raw)
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r13-3137-g30d6356773a838.
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 | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/analyzer/call-summary.cc b/gcc/analyzer/call-summary.cc
index bc50562b5ec..12ef82d18d6 100644
--- a/gcc/analyzer/call-summary.cc
+++ b/gcc/analyzer/call-summary.cc
@@ -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);
}
}
--
2.26.3
reply other threads:[~2022-10-06 19:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221006195038.807580-1-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).