aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2001-04-27 12:12:20 -0700
committerPer Bothner <bothner@gcc.gnu.org>2001-04-27 12:12:20 -0700
commit9c491eb84b89559a5420c3c43f99624970891b70 (patch)
treea781dca3d88559fb0843fe41e124e0ee09874c4a /gcc
parentd06146e1af25d55db3ee8e80dba9c2349632568c (diff)
downloadgcc-9c491eb84b89559a5420c3c43f99624970891b70.zip
gcc-9c491eb84b89559a5420c3c43f99624970891b70.tar.gz
gcc-9c491eb84b89559a5420c3c43f99624970891b70.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/parse.y18
2 files changed, 13 insertions, 10 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index d0f04ce..9a10cf4 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -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.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index a8084ee..de1bc66 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);