diff options
author | Andrew Benson <abenson@carnegiescience.edu> | 2020-03-02 17:28:35 +0000 |
---|---|---|
committer | Andrew Benson <abenson@carnegiescience.edu> | 2020-03-02 17:28:35 +0000 |
commit | f3c276aec26d9e406cc4bbf0e18b1105df63f0ee (patch) | |
tree | 3d9248c77f3e481f60c7c44f02170b2c10db01c7 /gcc/fortran | |
parent | d112e173ea093f55a16a14b26ef65088381ee09c (diff) | |
download | gcc-f3c276aec26d9e406cc4bbf0e18b1105df63f0ee.zip gcc-f3c276aec26d9e406cc4bbf0e18b1105df63f0ee.tar.gz gcc-f3c276aec26d9e406cc4bbf0e18b1105df63f0ee.tar.bz2 |
Ensure sufficient size of variables used for module+submodule names.
PR fortran/93486
* module.c: Increase size of variables used to read module names
when loading interfaces from module files to permit cases where
the name is the concatenation of a module and submodule name.
* gfortran.dg/pr93486.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/module.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1256b95..e3957fb 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2020-03-02 Andrew Benson <abensonca@gmail.com> + + PR fortran/93486 + * module.c: Increase size of variables used to read module names + when loading interfaces from module files to permit cases where + the name is the concatenation of a module and submodule name. + * gfortran.dg/pr93486.f90: New test. + 2020-03-01 Paul Thomas <pault@gcc.gnu.org> PR fortran/92976 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 4487f65..b6a4e87 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4568,7 +4568,9 @@ static void load_operator_interfaces (void) { const char *p; - char name[GFC_MAX_SYMBOL_LEN + 1], module[GFC_MAX_SYMBOL_LEN + 1]; + /* "module" must be large enough for the case of submodules in which the name + has the form module.submodule */ + char name[GFC_MAX_SYMBOL_LEN + 1], module[2 * GFC_MAX_SYMBOL_LEN + 2]; gfc_user_op *uop; pointer_info *pi = NULL; int n, i; @@ -4624,7 +4626,9 @@ static void load_generic_interfaces (void) { const char *p; - char name[GFC_MAX_SYMBOL_LEN + 1], module[GFC_MAX_SYMBOL_LEN + 1]; + /* "module" must be large enough for the case of submodules in which the name + has the form module.submodule */ + char name[GFC_MAX_SYMBOL_LEN + 1], module[2 * GFC_MAX_SYMBOL_LEN + 2]; gfc_symbol *sym; gfc_interface *generic = NULL, *gen = NULL; int n, i, renamed; |