[Bug java/22377] New: BC compilation fails to detect abstract instantiation

tromey at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Jul 8 19:08:00 GMT 2005


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



More information about the Java-prs mailing list