This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]