diff mbox series

[fortran,committed] Fix PR 84134

Message ID eaa197a2-a65f-f796-0817-5e7bf76efad4@netcologne.de
State New
Headers show
Series [fortran,committed] Fix PR 84134 | expand

Commit Message

Thomas Koenig Jan. 30, 2018, 10:37 p.m. UTC
Hello world,

another obvious fix, this time for an ice-on-invalid regression,
committed after regression-testing.

Regards

	Thomas

2017-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/84134
         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
         zero, return false.

2017-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/84134
diff mbox series

Patch

Index: array.c
===================================================================
--- array.c	(Revision 257131)
+++ array.c	(Arbeitskopie)
@@ -2245,9 +2245,12 @@  gfc_ref_dimen_size (gfc_array_ref *ar, int dimen,
       else
 	{
 	  stride_expr = gfc_copy_expr(ar->stride[dimen]); 
+
 	  if(!gfc_simplify_expr(stride_expr, 1))
 	    gfc_internal_error("Simplification error");
-	  if (stride_expr->expr_type != EXPR_CONSTANT)
+
+	  if (stride_expr->expr_type != EXPR_CONSTANT
+	      || mpz_cmp_ui (stride_expr->value.integer, 0) == 0)
 	    {
 	      mpz_clear (stride);
 	      return false;