Commit 2c6e2eb1 by Harald Anlauf Committed by Janus Weil

re PR fortran/70071 (ICE on wrong usage of a subscript triplet)

2017-07-06  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/70071
	* array.c (gfc_ref_dimen_size): Handle bad subscript triplets.


2017-07-06  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/70071
	* gfortran.dg/coarray_44.f90: New testcase.

From-SVN: r250039
parent 9ddfe5f4
2017-07-06 Harald Anlauf <anlauf@gmx.de>
PR fortran/70071
* array.c (gfc_ref_dimen_size): Handle bad subscript triplets.
2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/79866
......
......@@ -2203,9 +2203,15 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end)
bool t;
gfc_expr *stride_expr = NULL;
if (dimen < 0 || ar == NULL || dimen > ar->dimen - 1)
if (dimen < 0 || ar == NULL)
gfc_internal_error ("gfc_ref_dimen_size(): Bad dimension");
if (dimen > ar->dimen - 1)
{
gfc_error ("Bad array dimension at %L", &ar->c_where[dimen]);
return false;
}
switch (ar->dimen_type[dimen])
{
case DIMEN_ELEMENT:
......
2017-07-06 Harald Anlauf <anlauf@gmx.de>
PR fortran/70071
* gfortran.dg/coarray_44.f90: New testcase.
2017-07-06 Maxim Ostapenko <m.ostapenko@samsung.com>
* c-c++-common/asan/kasan-alloca-1.c: New test.
......
! { dg-do compile }
! { dg-options "-fcoarray=single" }
!
! PR fortran/70071
! Based on testcases by Gerhard Steinmetz
program pr70071
implicit none
integer, allocatable :: z(:)[:,:]
allocate (z(2)[1::2,*]) ! { dg-error "Bad array dimension" }
allocate (z(1::2)[2,*]) ! { dg-error "Bad array specification in ALLOCATE" }
end program pr70071
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment