Method call via interface calls wrong method...
David Daney
ddaney@avtrex.com
Mon Feb 23 22:55:00 GMT 2004
Andrew Haley wrote:
>Try this. Let me know if it fixes your problem.
>>Andrew.
>>2004年02月23日 Andrew Haley <aph@redhat.com>
>> * class.c (layout_class_methods): Check for CLASS_INTERFACE as
> well as CLASS_ABSTRACT.
>>Index: class.c
>===================================================================
>RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
>retrieving revision 1.176
>diff -p -2 -c -r1.176 class.c
>*** class.c 15 Jan 2004 10:24:25 -0000 1.176
>--- class.c 23 Feb 2004 20:55:22 -0000
>*************** layout_class_methods (tree this_class)
>*** 2054,2058 ****
> {
> tree method_decl, dtable_count;
>! tree super_class;
>> if (TYPE_NVIRTUALS (this_class))
>--- 2074,2078 ----
> {
> 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
>--- 2091,2096 ----
> 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
>>Sorry, with the patch, I cannot build libgcj.
I get these errors:
.
.
.
make[1]: Leaving directory `/home/daney/mipsel-gcccvs/mipsel-linux/boehm-gc'
make[1]: Entering directory `/home/daney/mipsel-gcccvs/mipsel-linux/libjava'
/home/daney/mipsel-gcccvs/gcc/gcj
-B/home/daney/mipsel-gcccvs/mipsel-linux/libjava/
-B/home/daney/mipsel-gcccvs/gcc/ --encoding=UTF-8 -Wno-deprecated -C -g
-classpath '' -bootclasspath
/home/daney/mipsel-gcccvs/mipsel-linux/libjava:../../../gcccvsw/gcc/libjava
-d /home/daney/mipsel-gcccvs/mipsel-linux/libjava
../../../gcccvsw/gcc/libjava/java/lang/Class.java
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:832: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readBoolean()' from class `java.io.ObjectInput'.
public boolean readBoolean() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:846: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readByte()' from class `java.io.ObjectInput'.
public byte readByte() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:860: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readUnsignedByte()' from class `java.io.ObjectInput'.
public int readUnsignedByte() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:902: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readChar()' from class `java.io.ObjectInput'.
public char readChar() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:874: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readShort()' from class `java.io.ObjectInput'.
public short readShort() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:888: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readUnsignedShort()' from class `java.io.ObjectInput'.
public int readUnsignedShort() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:916: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readInt()' from class `java.io.ObjectInput'.
public int readInt() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:930: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readLong()' from class `java.io.ObjectInput'.
public long readLong() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:944: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readFloat()' from class `java.io.ObjectInput'.
public float readFloat() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:958: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readDouble()' from class `java.io.ObjectInput'.
public double readDouble() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:992: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readLine()' from class `java.io.ObjectInput'.
public String readLine() throws IOException
^
../../../gcccvsw/gcc/libjava/java/io/ObjectInputStream.java:997: error:
Invalid checked exception class `java.io.IOException' in `throws'
clause. The exception must be a subclass of an exception thrown by
`java.io.ObjectInput.readUTF()' from class `java.io.ObjectInput'.
public String readUTF() throws IOException
.
.
.
More information about the Java
mailing list