backport: re PR fortran/80768 (NULL pointer dereferenced in gfc_check_num_images at fortran/check.c)

2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport of r250734 from mainline
	PR fortran/80768
	* check.c (gfc_check_num_images): Fix typo.

2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/80768
	* gfortran.dg/num_images_1.f90:  New test that tests fix in r250734.

From-SVN: r256907
This commit is contained in:
Steven G. Kargl 2018-01-19 23:37:29 +00:00
parent 30e8f455db
commit 7d94fb328d
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
Backport of r250734 from mainline
PR fortran/80768
* check.c (gfc_check_num_images): Fix typo.
2018-01-18 Harald Anlauf <anlauf@gmx.de> 2018-01-18 Harald Anlauf <anlauf@gmx.de>
Backport from mainline Backport from mainline

View File

@ -5156,7 +5156,7 @@ gfc_check_num_images (gfc_expr *distance, gfc_expr *failed)
return false; return false;
if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to " if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to "
"NUM_IMAGES at %L", &distance->where)) "NUM_IMAGES at %L", &failed->where))
return false; return false;
} }

View File

@ -1,3 +1,8 @@
2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/80768
* gfortran.dg/num_images_1.f90: New test that tests fix in r250734.
2018-01-18 Harald Anlauf <anlauf@gmx.de> 2018-01-18 Harald Anlauf <anlauf@gmx.de>
Backport from mainline Backport from mainline

View File

@ -0,0 +1,10 @@
! { dg-do compile }
! { dg-options "-fcoarray=single -std=f2008" }
! PR Fortran/80768
!
program foo
implicit none
integer k5
k5 = num_images(failed=.false.) ! { dg-error "argument to NUM_IMAGES" }
print *, k5
end program foo