This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: handle interface super correctly
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 18 Jan 2005 17:28:58 -0700
- Subject: [gcjx] Patch: FYI: handle interface super correctly
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
Internally we represent interfaces as not having a superclass. This
changes the class reader to properly handle this when parsing the
Signature attribute. This only matters when reading a generic
interface from a class file.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* bytecode/classreader.cc (parse_signature): Don't set superclass
for interface.
Index: bytecode/classreader.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/bytecode/Attic/classreader.cc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 classreader.cc
--- bytecode/classreader.cc 19 Jan 2005 00:00:42 -0000 1.1.2.2
+++ bytecode/classreader.cc 19 Jan 2005 00:32:19 -0000
@@ -576,7 +576,10 @@
ref_forwarding_type super;
std::list<ref_forwarding_type> ifaces;
parser.parse_class_signature (type_parameters, super, ifaces);
- result->set_superclass (super);
+ // Internally we represent interfaces as not having a
+ // superclass.
+ if (! result->interface_p ())
+ result->set_superclass (super);
result->set_type_parameters (type_parameters);
result->set_implements (ifaces);
}
@@ -896,7 +899,7 @@
{
result->set_interface ();
- // We check that the superclass name is set correct, but
+ // We check that the superclass name is set correctly, but
// internally we represent interfaces as not having a
// superclass.
if (super_class == 0