aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-10-11 17:37:50 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-10-11 17:37:50 +0000
commitd8c00a207cb6e3c2f057ba1f8f38f787863b862b (patch)
treeb2e07bc5053e75a7565dc119b945a3886ea72ab3 /libgfortran
parent652a8c1cde9cea866af3199c3e4a7fb1e7e909a3 (diff)
downloadgcc-d8c00a207cb6e3c2f057ba1f8f38f787863b862b.zip
gcc-d8c00a207cb6e3c2f057ba1f8f38f787863b862b.tar.gz
gcc-d8c00a207cb6e3c2f057ba1f8f38f787863b862b.tar.bz2
re PR fortran/38439 (I/O PD edit descriptor inconsistency)
2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/38439 * io/format.c (parse_format_list): Add check for tokens not allowed after P specifier. Fix comments. Remove un-needed code. Fix the default exponent list. Correct pointer assignment error. From-SVN: r152644
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/io/format.c26
2 files changed, 17 insertions, 16 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 014d883..0984287 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/38439
+ * io/format.c (parse_format_list): Add check for tokens not allowed
+ after P specifier. Fix comments. Remove un-needed code. Fix the
+ default exponent list. Correct pointer assignment error.
+
2009-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/35862
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 4ab70e8..7e46e3a 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -706,6 +706,12 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto data_desc;
}
+ if (t != FMT_COMMA && t != FMT_RPAREN && t != FMT_SLASH)
+ {
+ fmt->error = "Comma required after P descriptor";
+ goto finished;
+ }
+
fmt->saved_token = t;
goto optional_comma;
@@ -734,7 +740,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto between_desc;
case FMT_STRING:
- /* TODO: Find out why is is necessary to turn off format caching. */
+ /* TODO: Find out why it is necessary to turn off format caching. */
saveit = false;
get_fnode (fmt, &head, &tail, FMT_STRING);
tail->u.string.p = fmt->string;
@@ -851,19 +857,6 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
data_desc:
switch (t)
{
- case FMT_P:
- t = format_lex (fmt);
- if (t == FMT_POSINT)
- {
- fmt->error = "Repeat count cannot follow P descriptor";
- goto finished;
- }
-
- fmt->saved_token = t;
- get_fnode (fmt, &head, &tail, FMT_P);
-
- goto optional_comma;
-
case FMT_L:
t = format_lex (fmt);
if (t != FMT_POSINT)
@@ -971,6 +964,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
}
fmt->saved_token = t;
tail->u.real.d = 0;
+ tail->u.real.e = -1;
break;
}
@@ -982,11 +976,11 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
}
tail->u.real.d = fmt->value;
+ tail->u.real.e = -1;
- if (t == FMT_D || t == FMT_F)
+ if (t2 == FMT_D || t2 == FMT_F)
break;
- tail->u.real.e = -1;
/* Look for optional exponent */
t = format_lex (fmt);