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


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

[PATCH] Java: fixing error report, avoiding crash.



This patch fixes a problem found with the Java front-end:

  http://gcc.gnu.org/ml/java/2001-02/msg00213.html

It's a case of not reporting an error correctly and then crashing. So
I'm checking this in both the branch and the trunk.

./A

2001-02-13  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (resolve_qualified_expression_name): Try to resolve as
	an inner class access only if `decl' is a TYPE_DECL.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.251.2.1
diff -u -p -r1.251.2.1 parse.y
--- parse.y	2001/02/14 00:02:30	1.251.2.1
+++ parse.y	2001/02/14 00:21:59
@@ -9362,8 +9362,9 @@ resolve_qualified_expression_name (wfl, 
 	      field_decl = lookup_field_wrapper (type,
 						 EXPR_WFL_NODE (qual_wfl));
 
-	      /* Maybe what we're trying to access an inner class. */
-	      if (!field_decl)
+	      /* Maybe what we're trying to access to is an inner
+		 class, only if decl is a TYPE_DECL. */
+	      if (!field_decl && TREE_CODE (decl) == TYPE_DECL)
 		{
 		  tree ptr, inner_decl;
 


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