diff options
author | Tom Tromey <tromey@redhat.com> | 2006-03-15 18:29:44 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-03-15 18:29:44 +0000 |
commit | 88200a8dd114633fbdeeede0bcac824b37ce57bf (patch) | |
tree | 2ecb4b543663d3d4a29ca6755698fc74160ea415 /gcc/java/class.c | |
parent | 2afd35b3380c51f9eb6bab7ca37b2d883c4eb298 (diff) | |
download | gcc-88200a8dd114633fbdeeede0bcac824b37ce57bf.zip gcc-88200a8dd114633fbdeeede0bcac824b37ce57bf.tar.gz gcc-88200a8dd114633fbdeeede0bcac824b37ce57bf.tar.bz2 |
re PR java/26390 (Problem dispatching method call when method does not exist in superclass)
gcc/java
PR java/26390:
* class.c (get_interface_method_index): Don't put <clinit> into
interface table.
libjava
PR java/26390:
* link.cc (get_interfaces): Skip <clinit>.
(append_partial_itable): Likewise.
From-SVN: r112093
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index 743b9eb..6d666e3 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1,5 +1,5 @@ /* Functions related to building classes and their related objects. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -2303,18 +2303,21 @@ layout_class_methods (tree this_class) TYPE_NVIRTUALS (this_class) = dtable_count; } -/* Return the index of METHOD in INTERFACE. This index begins at 1 and is used as an - argument for _Jv_LookupInterfaceMethodIdx(). */ +/* Return the index of METHOD in INTERFACE. This index begins at 1 + and is used as an argument for _Jv_LookupInterfaceMethodIdx(). */ int get_interface_method_index (tree method, tree interface) { tree meth; int i = 1; - for (meth = TYPE_METHODS (interface); ; meth = TREE_CHAIN (meth), i++) + for (meth = TYPE_METHODS (interface); ; meth = TREE_CHAIN (meth)) { if (meth == method) return i; + /* We don't want to put <clinit> into the interface table. */ + if (! ID_CLINIT_P (DECL_NAME (meth))) + ++i; gcc_assert (meth != NULL_TREE); } } |