This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: gcj -vs- JServ


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]