public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/PR106133-json-diagnostics-fix)] diagnostics: fix crash with -fdiagnostics-format=json-file Date: Fri, 6 Jan 2023 10:21:26 +0000 (GMT) [thread overview] Message-ID: <20230106102126.62CB93858C1F@sourceware.org> (raw) https://gcc.gnu.org/g:e31e295120925353e7ad56c8bf47fd0564d4f745 commit e31e295120925353e7ad56c8bf47fd0564d4f745 Author: Martin Liska <mliska@suse.cz> Date: Fri Jan 6 11:19:52 2023 +0100 diagnostics: fix crash with -fdiagnostics-format=json-file PR middle-end/106133 gcc/ChangeLog: * diagnostic.cc (diagnostic_output_format_init): If -fdiagnostics-format=json-file and -E is used, then base_file_name is null and we should not emit anything. Diff: --- gcc/diagnostic.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index c90c14e993e..fe7d121e340 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -2277,6 +2277,9 @@ diagnostic_output_format_init (diagnostic_context *context, const char *base_file_name, enum diagnostics_output_format format) { + if (base_file_name == NULL) + return; + switch (format) { default:
reply other threads:[~2023-01-06 10:21 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=20230106102126.62CB93858C1F@sourceware.org \ --to=marxin@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).