This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR93473 - ICE on valid with long module + submodule names
- From: Andrew Benson <abenson at carnegiescience dot edu>
- To: Tobias Burnus <tobias at codesourcery dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Jan 2020 10:05:32 -0800
- Subject: Re: [patch, fortran] PR93473 - ICE on valid with long module + submodule names
- References: <1642803.1Q0mUWRIpW@andrew-precision-3520> <2668495.6d4l6sgZZe@andrew-precision-3520> <20fc777c-b931-2130-8bb5-08ed1bae1f86@codesourcery.com>
Thanks - committed as a83b5cc5828ee34471de415e8893242dd3b0a91b
https://gcc.gnu.org/git/gitweb.cgi?
p=gcc.git;a=commit;h=a83b5cc5828ee34471de415e8893242dd3b0a91b
I'll close the PR.
Thanks,
Andrew
On Tuesday, January 28, 2020 6:32:21 PM PST Tobias Burnus wrote:
> LGTM now.
>
> Thanks,
>
> Tobias
>
> On 1/28/20 5:41 PM, Andrew Benson wrote:
> > On Tuesday, January 28, 2020 9:27:58 AM PST Tobias Burnus wrote:
> >> 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];
> >
> > Yes - I've added a comment here explaining the naming convention. An
> > updated patch is attached.
> >
> > -Andrew
--
* Andrew Benson: http://users.obs.carnegiescience.edu/abenson/contact.html
* Galacticus: https://github.com/galacticusorg/galacticus