From: Per Bothner Date: Fri, 27 Apr 2001 19:12:20 +0000 (-0700) Subject: parse.y (java_expand_classes): Don't change ctxp_for_generation while iterating... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c491eb84b89559a5420c3c43f99624970891b70;p=gcc.git parse.y (java_expand_classes): Don't change ctxp_for_generation while iterating... * parse.y (java_expand_classes): Don't change ctxp_for_generation while iterating, since that could cause gc to lose stuff. From-SVN: r41640 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index d0f04cedbe5..9a10cf4b901 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2001-04-27 Per Bothner + + * 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 Fix method search wrt scope of inner classes to match JLS2. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index a8084ee1c06..de1bc667ec6 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -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);