[Bug fortran/34828] ICE: GNU MP: Cannot reallocate memory for gfortran.dg/parameter_array_init_3.f90

jvdelisle at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jan 30 06:57:00 GMT 2008



------- Comment #12 from jvdelisle at gcc dot gnu dot org  2008-01-30 01:56 -------
Here is first part of patch that takes care of the segfault.  This is also
helpful for pr19925:

@@ -1051,18 +1054,19 @@ find_array_element (gfc_constructor *con
       mpz_mul (span, span, tmp);
     }

-  if (cons)
-    {
-      for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--)
-       {
-         if (cons->iterator)
-           {
-             cons = NULL;
-             goto depart;
-           }
-         cons = cons->next;
-       }
-    }
+    for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--)
+      {
+        if (cons)
+         {
+           if (cons->iterator)
+             {
+               cons = NULL;
+               goto depart;
+             }
+           cons = cons->next;
+         }
+      }

 depart:
   mpz_clear (delta);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34828



More information about the Gcc-bugs mailing list