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
+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
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.
--- /dev/null
+! { 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