This is the mail archive of the java@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]

Re: ICE in inner class constructor.


I ran into a seemingly related problem where some programs in the
testsuite had an expected failure, but used to (unexpectedly) pass
earlier.  Now I don't remember exactly which cased failed, but I'll
try a re-build with the following patch.  Alex, if/when you look
into this problem, I suggest trying with this patch.

In both cases the problem was a mismatch between the formal parameters
of an inner class constructors, which takes *two* implicit arguments:
The "this" pointer of the object being constructed, and the "this"
pointer of context object of the outer class.  However, the actual
*call* only has the first of these implicit arguments - the context
pointer is not being passed.  The older testcase I remember failed
on a "this.new Inner(...)" form.


Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.223.2.10
diff -u -r1.223.2.10 tree.h
--- tree.h	2001/05/22 03:01:50	1.223.2.10
+++ tree.h	2001/05/26 16:53:19
@@ -798,10 +798,11 @@
 #define LOOP_EXPR_BODY(NODE) TREE_OPERAND (NODE, 0)
 
 /* In a EXPR_WITH_FILE_LOCATION node.  */
-#define EXPR_WFL_NODE(NODE) TREE_OPERAND((NODE), 0)
+#define EXPR_WFL_CHECK(NODE) TREE_CHECK (NODE, EXPR_WITH_FILE_LOCATION)
+#define EXPR_WFL_NODE(NODE) TREE_OPERAND(EXPR_WFL_CHECK (NODE), 0)
 #define EXPR_WFL_FILENAME(NODE) \
   (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE ((NODE))))
-#define EXPR_WFL_FILENAME_NODE(NODE) TREE_OPERAND((NODE), 1)
+#define EXPR_WFL_FILENAME_NODE(NODE) TREE_OPERAND (EXPR_WFL_CHECK (NODE), 1)
 #define EXPR_WFL_LINENO(NODE) (EXPR_CHECK (NODE)->exp.complexity >> 12)
 #define EXPR_WFL_COLNO(NODE) (EXPR_CHECK (NODE)->exp.complexity & 0xfff)
 #define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity)

-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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