This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: gcj -vs- JServ
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Subject: Patch: gcj -vs- JServ
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 29 Jun 2000 13:13:32 -0600
- Cc: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Reply-To: tromey at cygnus dot com
I'm trying to build JServ with the latest gcj. I get a SEGV in
resolve_field_access, because resolve_qualified_expression_name can
sometimes return with type_found==NULL but decl!=NULL.
The function already accounts for this later on; it is just the first
`if' that checks type_found that has a problem. Furthermore the
problem only occurs if the decl is named `length'.
Here is a patch. Ok to commit?
2000-06-29 Tom Tromey <tromey@cygnus.com>
* parse.y (resolve_field_access): Handle case where `type_found'
is NULL.
Tom
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.186
diff -u -r1.186 parse.y
--- parse.y 2000/06/27 15:02:48 1.186
+++ parse.y 2000/06/29 19:06:52
@@ -8719,7 +8719,7 @@
/* Resolve the LENGTH field of an array here */
if (DECL_P (decl) && DECL_NAME (decl) == length_identifier_node
- && TYPE_ARRAY_P (type_found)
+ && type_found && TYPE_ARRAY_P (type_found)
&& ! flag_emit_class_files && ! flag_emit_xref)
{
tree length = build_java_array_length_access (where_found);