diff mbox

[fortran] Fix PR 62142

Message ID 53EE799E.1000403@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig Aug. 15, 2014, 9:20 p.m. UTC
Hello world,

I committed the attached patch as obvious to trunk after regression
testing.  It fixes the regression in the test case by adding
a NULL check to a pointer.  Will commit to 4.9 soon.

Regards

	Thomas

2014-08-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/62142
        * trans-expr.c (is_runtime_conformable):  Add NULL pointer check.

2014-08-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/62142
        * gfortran.dg/realloc_on_assign_24.f90:  New test.
diff mbox

Patch

Index: trans-expr.c
===================================================================
--- trans-expr.c	(Revision 213778)
+++ trans-expr.c	(Arbeitskopie)
@@ -7895,7 +7895,7 @@  is_runtime_conformable (gfc_expr *expr1, gfc_expr
 	  for (a = expr2->value.function.actual; a != NULL; a = a->next)
 	    {
 	      e1 = a->expr;
-	      if (e1->rank > 0 && !is_runtime_conformable (expr1, e1))
+	      if (e1 && e1->rank > 0 && !is_runtime_conformable (expr1, e1))
 		return false;
 	    }
 	  return true;
@@ -7906,7 +7906,7 @@  is_runtime_conformable (gfc_expr *expr1, gfc_expr
 	  for (a = expr2->value.function.actual; a != NULL; a = a->next)
 	    {
 	      e1 = a->expr;
-	      if (e1->rank > 0 && !is_runtime_conformable (expr1, e1))
+	      if (e1 && e1->rank > 0 && !is_runtime_conformable (expr1, e1))
 		return false;
 	    }
 	  return true;