public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015 Date: Mon, 15 Jun 2020 20:21:02 +0000 [thread overview] Message-ID: <bug-95689-4-lPBJhyyvwo@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95689-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED CC| |anlauf at gcc dot gnu.org Ever confirmed|0 |1 Priority|P3 |P4 Summary|ICE in |[8/9/10/11 Regression] ICE |check_sym_interfaces, at |in check_sym_interfaces, at |fortran/interface.c:2015 |fortran/interface.c:2015 Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org --- Comment #2 from anlauf at gcc dot gnu.org --- Technically an 8/9/10/11 regression. The following patch fixes the ICE for me: diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index f33c6632b45..b1a75a37b0e 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1981,7 +1981,8 @@ check_interface1 (gfc_interface *p, gfc_interface *q0, static void check_sym_interfaces (gfc_symbol *sym) { - char interface_name[GFC_MAX_SYMBOL_LEN + sizeof("generic interface ''")]; + /* Provide sufficient space to hold "generic interface 'symbol.symbol'". */ + char interface_name[2*GFC_MAX_SYMBOL_LEN+2 + sizeof("generic interface ''")]; gfc_interface *p; if (sym->ns != gfc_current_ns) @@ -1989,6 +1990,8 @@ check_sym_interfaces (gfc_symbol *sym) if (sym->generic != NULL) { + size_t len = strlen (sym->name) + sizeof("generic interface ''"); + gcc_assert (len < sizeof (interface_name)); sprintf (interface_name, "generic interface '%s'", sym->name); if (check_interface0 (sym->generic, interface_name)) return; Not regtested yet. The testcase may show subsequent fallout elsewhere (i.e. for builds with special protection against buffer overflows).
next prev parent reply other threads:[~2020-06-15 20:21 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-15 18:45 [Bug fortran/95689] New: " gscfq@t-online.de 2020-06-15 19:10 ` [Bug fortran/95689] " marxin at gcc dot gnu.org 2020-06-15 20:21 ` anlauf at gcc dot gnu.org [this message] 2020-06-15 20:48 ` [Bug fortran/95689] [8/9/10/11 Regression] " anlauf at gcc dot gnu.org 2020-06-16 6:40 ` rguenth at gcc dot gnu.org 2020-06-20 14:10 ` cvs-commit at gcc dot gnu.org 2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org 2020-06-23 20:21 ` cvs-commit at gcc dot gnu.org 2020-06-23 20:40 ` cvs-commit at gcc dot gnu.org 2020-06-23 20:42 ` anlauf at gcc dot gnu.org 2020-06-24 20:41 ` cvs-commit at gcc dot gnu.org 2020-06-24 20:45 ` cvs-commit at gcc dot gnu.org 2020-06-25 18:51 ` anlauf at gcc dot gnu.org
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=bug-95689-4-lPBJhyyvwo@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).