public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Andrew Benson <abenson@carnegiescience.edu>, <fortran@gcc.gnu.org>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, fortran] PR93473 - ICE on valid with long module + submodule names
Date: Tue, 28 Jan 2020 08:57:00 -0000	[thread overview]
Message-ID: <feb8bb04-8449-093a-7f17-996c08b2b291@codesourcery.com> (raw)
In-Reply-To: <2379883.S0vcn17Cz5@andrew-precision-3520>

On 1/28/20 12:41 AM, Andrew Benson wrote:
> The problem occurs in set_syms_host_assoc() where the "parent1" and "parent2"
> variables have a maximum length of GFC_MAX_SYMBOL_LEN+1. This is insufficient
> when the parent names are a module+submodule name concatenated with a ".". The
> patch above fixes this by increasing their length to 2*GFC_MAX_SYMBOL_LEN+2.
>
> A patch to fix this is attached. The patch regression tests cleanly - ok to
> commit?

The patch is okay, but can you add a comment – similar to the other 
patch – which makes clear why one needs twice the normal 
GFC_MAX_SYMBOL_LEN (+2)? You currently have:

>     const char dot[2] = ".";
> -  char parent1[GFC_MAX_SYMBOL_LEN + 1];
> -  char parent2[GFC_MAX_SYMBOL_LEN + 1];
> +  char parent1[2 * GFC_MAX_SYMBOL_LEN + 2];
> +  char parent2[2 * GFC_MAX_SYMBOL_LEN + 2];

Tobias


  reply	other threads:[~2020-01-28  8:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1642803.1Q0mUWRIpW@andrew-precision-3520>
2018-09-04 16:43 ` [patch, fortan] PR87103 - [OOP] ICE in gfc_new_symbol() due to overlong symbol name Andrew Benson
2018-09-04 17:43   ` Bernhard Reutner-Fischer
     [not found]     ` <5aa0135b-1bdd-46de-e235-daed0a9a97e1@charter.net>
2018-09-05 10:35       ` Bernhard Reutner-Fischer
2018-09-05 14:24         ` Andrew Benson
2019-08-24 14:50         ` Andrew Benson
2019-08-28 19:58           ` Bernhard Reutner-Fischer
2019-08-28 20:08             ` Andrew Benson
2020-01-29 22:49             ` Andrew Benson
2020-01-30 16:50               ` Bernhard Reutner-Fischer
2020-01-30 20:39                 ` Andrew Benson
2020-01-27 21:49   ` [patch, fortran] PR93461 - Bogus "symbol is already defined" with long subroutine names in submodule Andrew Benson
2020-01-28  8:50     ` Tobias Burnus
2020-01-28 16:46       ` Andrew Benson
2020-01-28 18:05         ` Tobias Burnus
2020-01-28 18:58           ` Andrew Benson
2020-01-29  2:11           ` [patch, fortran, wwwdocs] " Andrew Benson
2020-01-29  9:53             ` Gerald Pfeifer
2020-01-29 11:12             ` Tobias Burnus
2020-01-29 17:45               ` Andrew Benson
2020-01-28  0:03   ` [patch, fortran] PR93473 - ICE on valid with long module + submodule names Andrew Benson
2020-01-28  8:57     ` Tobias Burnus [this message]
2020-01-28 16:45       ` Andrew Benson
2020-01-28 17:51         ` Tobias Burnus
2020-01-28 18:49           ` Andrew Benson

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=feb8bb04-8449-093a-7f17-996c08b2b291@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=abenson@carnegiescience.edu \
    --cc=fortran@gcc.gnu.org \
    --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).