diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2024-02-16 17:06:37 -0800 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2024-02-17 07:34:12 -0800 |
commit | fccfe6625121512f247cb59888e50eb9dcc84409 (patch) | |
tree | 515a294f42cbd02bf3d7711dbd734268ce401060 /libgfortran | |
parent | 876fa432ef4074053fa65b1855e7d43320515576 (diff) | |
download | gcc-fccfe6625121512f247cb59888e50eb9dcc84409.zip gcc-fccfe6625121512f247cb59888e50eb9dcc84409.tar.gz gcc-fccfe6625121512f247cb59888e50eb9dcc84409.tar.bz2 |
libgfortran: Fix namelist read.
PR libfortran/107068
libgfortran/ChangeLog:
* io/list_read.c (read_logical): When looking for a possible
variable name, check for left paren, indicating a possible
array reference.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr107068.f90: New test.
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/io/list_read.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index f8ca644..0b7884f 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -888,6 +888,14 @@ read_logical (st_parameter_dt *dtp, int length) for(i = 0; i < 63; i++) { c = next_char (dtp); + if (c == '(') + { + l_push_char (dtp, c); + dtp->u.p.nml_read_error = 1; + dtp->u.p.line_buffer_enabled = 1; + dtp->u.p.line_buffer_pos = 0; + return; + } if (is_separator(c)) { /* All done if this is not a namelist read. */ |