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] Java: fix to the PR #102


I'm checking in this patch which fixes the Java PR #102:

  http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00152.html

./A

2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (qualify_ambiguous_name): Properly handle expressions
	using `null'.
	
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.141
diff -u -p -r1.141 parse.y
--- parse.y	2000/03/08 00:30:06	1.141
+++ parse.y	2000/03/08 00:53:57
@@ -7942,6 +7942,9 @@ qualify_ambiguous_name (id)
 	&& TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION)
       name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl));
 
+    else if (code == INTEGER_CST)
+      name = qual_wfl;
+    
     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));
@@ -7996,8 +7999,9 @@ qualify_ambiguous_name (id)
      declaration or parameter declaration, then it is an expression
      name. We don't carry this test out if we're in the context of the
      use of SUPER or THIS */
-  if (!this_found && !super_found && 
-      TREE_CODE (name) != STRING_CST && (decl = IDENTIFIER_LOCAL_VALUE (name)))
+  if (!this_found && !super_found 
+      && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST
+      && (decl = IDENTIFIER_LOCAL_VALUE (name)))
     {
       RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
       QUAL_RESOLUTION (qual) = decl;
@@ -8023,8 +8027,8 @@ qualify_ambiguous_name (id)
      - NAME is declared by exactly on type-import-on-demand declaration
      of the compilation unit containing NAME. 
      - NAME is actually a STRING_CST. */
-  else if (TREE_CODE (name) == STRING_CST ||
-	   (decl = resolve_and_layout (name, NULL_TREE)))
+  else if (TREE_CODE (name) == STRING_CST || TREE_CODE (name) == INTEGER_CST
+	   || (decl = resolve_and_layout (name, NULL_TREE)))
     {
       RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
       QUAL_RESOLUTION (qual) = decl;



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