PR fortran/67614
* resolve.c (gfc_resolve_code): Prevent ICE for invalid EXPR_NULL.
2015-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67614
* gfortran.dg/pr67614.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228156
138bc75d-0d04-0410-961f-
82ee72b054a4
2015-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
+ PR fortran/67614
+ * resolve.c (gfc_resolve_code): Prevent ICE for invalid EXPR_NULL.
+
+2015-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
+
PR fortran/67525
* parse.c (match_deferred_characteristics): Remove an assert, which
allows an invalid SELECT TYPE selector to be detected.
{
gfc_expr *e = code->expr1;
+ gfc_resolve_expr (e);
+ if (e->expr_type == EXPR_NULL)
+ gfc_error ("Invalid NULL at %L", &e->where);
+
if (t && (e->rank > 0
|| !(e->ts.type == BT_REAL || e->ts.type == BT_INTEGER)))
gfc_error ("Arithmetic IF statement at %L requires a scalar "
- "REAL or INTEGER expression", &code->expr1->where);
+ "REAL or INTEGER expression", &e->where);
resolve_branch (code->label1, code);
resolve_branch (code->label2, code);
2015-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
+ PR fortran/67614
+ * gfortran.dg/pr67614.f90: New test.
+
+2015-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
+
PR fortran/67525
* gfortran.dg/pr67525.f90: New test.
--- /dev/null
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+! PR fortran/67614
+!
+program foo
+ implicit none
+ integer, pointer :: z
+ if (null(z)) 10, 20, 30 ! { dg-error "Invalid NULL" }
+10 continue
+20 continue
+30 continue
+end program foo