Patch: gcj and rhug build failure
Tom Tromey
tromey@redhat.com
Thu Jan 30 02:38:00 GMT 2003
On x86 Red Hat Linux 7.3, gcj (current 3.3 trunk) fails to compile the
current cvs rhug. It dies saying that it is "reading class
gnu.gcj.runtime.StringBuffer for the second time" when compiling
BinOpExpr.java.
What happens is that jcf_parse() changes the value of `current_class'
when reading this class for the first time. However, we fail to put
the new class value back into the IDENTIFIER_CLASS_VALUE for the
class. So, the next time we need this class we try to read it again,
leading to the problem.
I don't know why this happens with this file and not any others.
The appended patch fixes this problem. I've tested this patch the
usual way: rebuild libgcj from scratch, run test suite, then rebuilt
rhug. There were no regressions.
Ok to commit for 3.3 and trunk?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* jcf-parse.c (read_class): Update identifier's class value if it
changed during parsing.
Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.124
diff -u -r1.124 jcf-parse.c
--- jcf-parse.c 18 Nov 2002 15:46:33 -0000 1.124
+++ jcf-parse.c 29 Jan 2003 22:15:04 -0000
@@ -1,5 +1,5 @@
/* Parser for Java(TM) .class files.
- Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -548,6 +548,10 @@
read_zip_member(current_jcf,
current_jcf->zipd, current_jcf->zipd->zipf);
jcf_parse (current_jcf);
+ /* Parsing might change the class, in which case we have to
+ put it back where we found it. */
+ if (current_class != class && icv != NULL_TREE)
+ TREE_TYPE (icv) = current_class;
class = current_class;
java_pop_parser_context (0);
java_parser_context_restore_global ();
More information about the Java-patches
mailing list