Commit 42aed357 by Martin Liska Committed by Martin Liska

Bail out in gfc_dep_compare_expr for a NULL argument.

2019-12-10  Martin Liska  <mliska@suse.cz>

	PR fortran/92874
	* dependency.c (gfc_dep_compare_expr): Bail out
	when one of the arguments is null.
2019-12-10  Martin Liska  <mliska@suse.cz>

	PR fortran/92874
	* gfortran.dg/pr92874.f90: New test.

From-SVN: r279181
parent f812dfe8
2019-12-10 Martin Liska <mliska@suse.cz>
PR fortran/92874
* dependency.c (gfc_dep_compare_expr): Bail out
when one of the arguments is null.
2019-12-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92863
......
......@@ -319,6 +319,8 @@ gfc_dep_compare_expr (gfc_expr *e1, gfc_expr *e2)
if (e1 == NULL && e2 == NULL)
return 0;
else if (e1 == NULL || e2 == NULL)
return -2;
e1 = gfc_discard_nops (e1);
e2 = gfc_discard_nops (e2);
......
2019-12-10 Martin Liska <mliska@suse.cz>
PR fortran/92874
* gfortran.dg/pr92874.f90: New test.
2019-12-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92863
......
! { dg-do compile }
! { dg-options "-O2" }
! PR fortran/92874
program p
call s('a')
call s('abc')
end
subroutine s(x)
character(*) :: x
print *, (x(1:1) == x(1:))
end
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