parse.y (java_expand_classes): Don't change ctxp_for_generation while iterating...
authorPer Bothner <per@bothner.com>
Fri, 27 Apr 2001 19:12:20 +0000 (12:12 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Fri, 27 Apr 2001 19:12:20 +0000 (12:12 -0700)
* parse.y (java_expand_classes):  Don't change ctxp_for_generation
while iterating, since that could cause gc to lose stuff.

From-SVN: r41640

gcc/java/ChangeLog
gcc/java/parse.y

index d0f04cedbe575bb6c9e49402c1423edf67125ce8..9a10cf4b90159b77eaad00edd9d984da41b8fb6e 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-27  Per Bothner  <per@bothner.com>
+
+       * parse.y (java_expand_classes):  Don't change ctxp_for_generation
+       while iterating, since that could cause gc to lose stuff.
+
 2001-04-26  Per Bothner  <per@bothner.com>
 
        Fix method search wrt scope of inner classes to match JLS2.
index a8084ee1c06f579761efcac15db5b0e2f3e90792..de1bc667ec6b45f0ef6e433334340edd376d89c3 100644 (file)
@@ -8627,7 +8627,7 @@ void
 java_expand_classes ()
 {
   int save_error_count = 0;
-  static struct parser_ctxt *saved_ctxp = NULL;
+  static struct parser_ctxt *cur_ctxp = NULL;
 
   java_parse_abort_on_error ();
   if (!(ctxp = ctxp_for_generation))
@@ -8635,10 +8635,10 @@ java_expand_classes ()
   java_layout_classes ();
   java_parse_abort_on_error ();
 
-  saved_ctxp = ctxp_for_generation;
-  for (; ctxp_for_generation; ctxp_for_generation = ctxp_for_generation->next)
+  cur_ctxp = ctxp_for_generation;
+  for (; cur_ctxp; cur_ctxp = cur_ctxp->next)
     {
-      ctxp = ctxp_for_generation;
+      ctxp = cur_ctxp;
       input_filename = ctxp->filename;
       lang_init_source (2);           /* Error msgs have method prototypes */
       java_complete_expand_classes (); /* Complete and expand classes */
@@ -8648,11 +8648,10 @@ java_expand_classes ()
 
   /* Find anonymous classes and expand their constructor, now they
      have been fixed. */
-  for (ctxp_for_generation = saved_ctxp;
-       ctxp_for_generation; ctxp_for_generation = ctxp_for_generation->next)
+  for (cur_ctxp = ctxp_for_generation;  cur_ctxp;  cur_ctxp = cur_ctxp->next)
     {
       tree current;
-      ctxp = ctxp_for_generation;
+      ctxp = cur_ctxp;
       for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
        {
          current_class = TREE_TYPE (current);
@@ -8682,11 +8681,10 @@ java_expand_classes ()
     return;
 
   /* Now things are stable, go for generation of the class data. */
-  for (ctxp_for_generation = saved_ctxp;
-       ctxp_for_generation; ctxp_for_generation = ctxp_for_generation->next)
+  for (cur_ctxp = ctxp_for_generation;  cur_ctxp;  cur_ctxp = cur_ctxp->next)
     {
       tree current;
-      ctxp = ctxp_for_generation;
+      ctxp = cur_ctxp;
       for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
        {
          current_class = TREE_TYPE (current);