This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/22377] New: BC compilation fails to detect abstract instantiation
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2005 19:08:38 -0000
- Subject: [Bug java/22377] New: BC compilation fails to detect abstract instantiation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Suppose you have bytecode that tries to instantiate an abstract class.
The compiler accepts this (as it ought to), but then at runtime the
instantiation succeeds. Instead it should throw InstantiationException
(This problem applies to interfaces as well.)
The simplest way to fix this would be to add a check to _Jv_AllocObject
and friends. However, this may be too expensive (we want to keep allocation
paths short...)
Another approach would be a table of "new pointers", which points to the
allocator for any class instantiated from the current compilation unit.
This could be filled in at link time.
--
Summary: BC compilation fails to detect abstract instantiation
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tromey at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
OtherBugsDependingO 12725
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22377