This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: PR java/5848
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Alexandre Petit-Bianco <apbianco at redhat dot com>
- Date: 06 Mar 2002 18:23:02 -0700
- Subject: Patch: PR java/5848
- Reply-to: tromey at redhat dot com
This patch fixes PR java/5848.
The relevant code looks like this:
for (Enumeration e = data.elements() ; e.hasMoreElements() ;) {
sz =+ ((byte[])e.nextElement()).length;
In this case we were generating a call_expr (to check the cast)
wrapped in a convert. qualify_ambiguous_name didn't handle this case.
Frankly this patch feels like a hack. It seems to be in the spirit of
this function, in that it handles another case by unwrapping
extraneous layers of trees. However, I'm concerned because there
might very well be other cases that ought to be handled here.
I'm going to rebuild libgcj with this shortly. Meanwhile, Alex, what
do you think?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is
a call_expr wrapped in a convert. Fixes PR java/5848.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.356
diff -u -r1.356 parse.y
--- parse.y 2002/03/03 14:07:32 1.356
+++ parse.y 2002/03/07 00:49:43
@@ -11276,11 +11282,17 @@
else if (code == INTEGER_CST)
name = qual_wfl;
-
+
else if (code == CONVERT_EXPR &&
TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION)
name = TREE_OPERAND (qual_wfl, 0);
-
+
+ else if (code == CONVERT_EXPR
+ && TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == CALL_EXPR
+ && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (qual_wfl, 0), 0))
+ == EXPR_WITH_FILE_LOCATION))
+ name = TREE_OPERAND (TREE_OPERAND (qual_wfl, 0), 0);
+
else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) &&
TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0));