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]
Other format: [Raw text]

[PATCH] Java: Fix PR 12866


Depending on whether compiling to native or bytecode, the parser was
taking different paths to check_thrown_exceptions.  Rather than duplicate
the test for OUTER_FIELD_IDENTIFIER_ACCESS_P, I opted to move it into the
function.

Tested by rebuilding jc1, libjava and running libjava testsuite.  OK for
mainline?

Jeff

2003-10-31  Jeff Sturm  <jsturm@one-point.com>

	Fixes PR java/12866.
	* parse.y (resolve_qualified_expression_name): Move test
	for outer field access methods from here...
	(check_thrown_exceptions) ...to here.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.451
diff -u -p -r1.451 parse.y
--- parse.y	22 Oct 2003 18:06:38 -0000	1.451
+++ parse.y	1 Nov 2003 02:41:23 -0000
@@ -9601,10 +9601,7 @@ resolve_qualified_expression_name (tree
 	     instantiation using a primary qualified by a `new' */
 	  RESTORE_THIS_AND_CURRENT_CLASS;

-	  /* EH check. No check on access$<n> functions */
-	  if (location
-	      && !OUTER_FIELD_ACCESS_IDENTIFIER_P
-	            (DECL_NAME (current_function_decl)))
+	  if (location)
 	    {
 	      tree arguments = NULL_TREE;
 	      if (TREE_CODE (qual_wfl) == CALL_EXPR
@@ -15782,6 +15783,10 @@ check_thrown_exceptions (int location, t
 {
   tree throws;
   int is_array_call = 0;
+
+  /* Skip check within generated methods, such as access$<n>.  */
+  if (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl)))
+    return;

   if (this_expr != NULL_TREE
       && TREE_CODE (TREE_TYPE (this_expr)) == POINTER_TYPE



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