diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-01-18 12:11:57 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-01-18 12:11:57 -0500 |
commit | e254d1224df306a07f3b0b572af2582f509b7d67 (patch) | |
tree | 92537350db485a061d93bc404f16ffb1d96a52d8 /gcc/toplev.cc | |
parent | 8cddf6f833e1c7a132fff9fa407cedf9fdf38bd9 (diff) | |
download | gcc-e254d1224df306a07f3b0b572af2582f509b7d67.zip gcc-e254d1224df306a07f3b0b572af2582f509b7d67.tar.gz gcc-e254d1224df306a07f3b0b572af2582f509b7d67.tar.bz2 |
Fix ICE in -fdiagnostics-generate-patch [PR112684]
gcc/ChangeLog:
PR middle-end/112684
* toplev.cc (toplev::main): Don't ICE in
-fdiagnostics-generate-patch when exiting after options,
since no edit context will have been created.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/toplev.cc')
-rw-r--r-- | gcc/toplev.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/toplev.cc b/gcc/toplev.cc index 55636ff..175d4cd 100644 --- a/gcc/toplev.cc +++ b/gcc/toplev.cc @@ -2323,11 +2323,8 @@ toplev::main (int argc, char **argv) emit some diagnostics here. */ invoke_plugin_callbacks (PLUGIN_FINISH, NULL); - if (flag_diagnostics_generate_patch) + if (auto edit_context_ptr = global_dc->get_edit_context ()) { - auto edit_context_ptr = global_dc->get_edit_context (); - gcc_assert (edit_context_ptr); - pretty_printer pp; pp_show_color (&pp) = pp_show_color (global_dc->printer); edit_context_ptr->print_diff (&pp, true); |