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 tree-optimization/47290] [4.5/4.6 Regression] memory exhausted compiling a destructor with an infinite 'for (;;);' loop


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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-18 13:10:19 UTC ---
We could also limit the number of iterations:
   int i;

-  for (i = 1; VEC_iterate (eh_landing_pad, cfun->eh->lp_array, i, lp); ++i)
+  int len = VEC_length (eh_landing_pad, cfun->eh->lp_array) * 2;
+  for (i = 1; 
+       VEC_iterate (eh_landing_pad, cfun->eh->lp_array, i, lp) && i < len;
+       i++)
     if (lp)
       changed |= cleanup_empty_eh (lp);


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