re PR fortran/85520 (Out of memory when declaring a character with len << 0)
2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85520 * decl.c (gfc_match_char_spec): Check for negative length and set to 0. 2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85520 * gfortran.dg/pr85520.f90: New test. From-SVN: r259623
This commit is contained in:
parent
08417efa3a
commit
58da192e7a
4 changed files with 22 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/85520
|
||||
* decl.c (gfc_match_char_spec): Check for negative length and set to 0.
|
||||
|
||||
2018-04-14 Andre Vehreschild <vehre@gcc.gnu.org>
|
||||
|
||||
PR fortran/81773
|
||||
|
|
|
@ -3235,7 +3235,11 @@ done:
|
|||
e = gfc_copy_expr (len);
|
||||
gfc_reduce_init_expr (e);
|
||||
if (e->expr_type == EXPR_CONSTANT)
|
||||
gfc_replace_expr (len, e);
|
||||
{
|
||||
gfc_replace_expr (len, e);
|
||||
if (mpz_cmp_si (len->value.integer, 0) < 0)
|
||||
mpz_set_ui (len->value.integer, 0);
|
||||
}
|
||||
else
|
||||
gfc_free_expr (e);
|
||||
cl->length = len;
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/85520
|
||||
* gfortran.dg/pr85520.f90: New test.
|
||||
|
||||
2018-04-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
PR target/85512
|
||||
|
|
7
gcc/testsuite/gfortran.dg/pr85520.f90
Normal file
7
gcc/testsuite/gfortran.dg/pr85520.f90
Normal file
|
@ -0,0 +1,7 @@
|
|||
! { dg-do run }
|
||||
! PR fortran/85520
|
||||
! Original code from Gerhard Steinmetz <gscfq at t-online dot de>
|
||||
program p
|
||||
character(-huge(1)) :: c = ' '
|
||||
if (len(c) /= 0) stop 1
|
||||
end
|
Loading…
Add table
Reference in a new issue