mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-25 09:24:06 +08:00
re PR fortran/35036 (illegal E format descriptor produces wrong output)
2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/35036 * write_float.def (output_float): Add error checks for zero digits after decimal point in E and D format specifiers. From-SVN: r132510
This commit is contained in:
parent
eac9ed5e34
commit
50a932e0cb
@ -1,3 +1,9 @@
|
||||
2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libfortran/35036
|
||||
* write_float.def (output_float): Add error checks for zero digits
|
||||
after decimal point in E and D format specifiers.
|
||||
|
||||
2008-02-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libfortran/35063
|
||||
|
@ -167,6 +167,19 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
|
||||
case FMT_E:
|
||||
case FMT_D:
|
||||
i = dtp->u.p.scale_factor;
|
||||
if (d <= 0 && i == 0)
|
||||
{
|
||||
generate_error (&dtp->common, LIBERROR_FORMAT, "Precision not "
|
||||
"greater than zero in format specifier 'E' or 'D'");
|
||||
return;
|
||||
}
|
||||
if (i <= -d || i >= d + 2)
|
||||
{
|
||||
generate_error (&dtp->common, LIBERROR_FORMAT, "Scale factor "
|
||||
"out of range in format specifier 'E' or 'D'");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!zero_flag)
|
||||
e -= i;
|
||||
if (i < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user