This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
- 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: 18 Feb 2005 00:53:09 -0000
- Subject: [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
- References: <20050217234912.20044.bonniot@users.sf.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tromey at gcc dot gnu dot org 2005-02-18 00:53 -------
This bug occurs in 3 places.
* In the interpreter and the old abi, the problem is similar.
We do not properly implement the ACC_SUPER semantics of the
invokespecial opcode. The fix in both these cases is similar,
the "invokespecial Object.equals" must be changed into a
non-virtual call to "A.equals"
* In the BC ABI, the problem is the same, but the solution is different.
We can't search the concrete class hierarchy in the compiler.
Instead we must emit an atable (not otable, as the resulting call
will be nonvirtual) reference for the method. However, it must be
a special atable reference, since we cannot know the precise name
of the declaring class. One approach to fixing this would be to
emit a name like "+ClassNameHere" to indicate that we must search.
Or, better, some magic value like (void*)1 or NULL would suffice here
(since we know we must always start the search with the current class'
superclass)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044