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

[3.4/3.5 Regression] java/14231: Incorrect interface method called when compiling against .class files


Another Miranda bug: we mark interfaces as abstract, but Sun
don't.  Every interface is implicitly abstract, however.

Andrew.


2004-02-26  Andrew Haley  <aph@redhat.com>

	PR java/14231:
	* parse.y (check_interface_throws_clauses): Check for
	!METHOD_INVISIBLE (iface_method).
	* class.c (layout_class_methods): Check for CLASS_INTERFACE as
	well as CLASS_ABSTRACT.
	
Index: gcc/java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.176
diff -p -2 -c -r1.176 class.c
*** gcc/java/class.c	15 Jan 2004 10:24:25 -0000	1.176
--- gcc/java/class.c	25 Feb 2004 19:31:00 -0000
*************** layout_class_methods (tree this_class)
*** 2054,2058 ****
  {
    tree method_decl, dtable_count;
!   tree super_class;
  
    if (TYPE_NVIRTUALS (this_class))
--- 2054,2058 ----
  {
    tree method_decl, dtable_count;
!   tree super_class, type_name;
  
    if (TYPE_NVIRTUALS (this_class))
*************** layout_class_methods (tree this_class)
*** 2071,2075 ****
      dtable_count = integer_zero_node;
  
!   if (CLASS_ABSTRACT (TYPE_NAME (this_class)))
      {
        /* An abstract class can have methods which are declared only in
--- 2071,2076 ----
      dtable_count = integer_zero_node;
  
!   type_name = TYPE_NAME (this_class);
!   if (CLASS_ABSTRACT (type_name) || CLASS_INTERFACE (type_name))
      {
        /* An abstract class can have methods which are declared only in
Index: gcc/java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.464.4.1
diff -p -2 -c -r1.464.4.1 parse.y
*** gcc/java/parse.y	27 Jan 2004 17:27:39 -0000	1.464.4.1
--- gcc/java/parse.y	25 Feb 2004 19:31:04 -0000
*************** check_interface_throws_clauses (tree che
*** 6525,6529 ****
  		 clauses is fine in the absence of a concrete
  		 implementation.  */
! 	      if (method != NULL_TREE && !METHOD_ABSTRACT (method))
  		{
  		  tree method_wfl = DECL_FUNCTION_WFL (method);
--- 6525,6530 ----
  		 clauses is fine in the absence of a concrete
  		 implementation.  */
! 	      if (method != NULL_TREE && !METHOD_ABSTRACT (method)
! 		  && !METHOD_INVISIBLE (iface_method))
  		{
  		  tree method_wfl = DECL_FUNCTION_WFL (method);


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