Summary: | Wrong method call semantics (maybe instanceof/invokespecial) | ||
---|---|---|---|
Product: | gcc | Reporter: | Daniel Bonniot <bonniot> |
Component: | java | Assignee: | Andrew Haley <aph> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | aph, gcc-bugs, java-prs |
Priority: | P2 | Keywords: | wrong-code |
Version: | 4.0.0 | ||
Target Milestone: | --- | ||
Host: | i386-debian-linux-gnu | Target: | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2006-07-19 03:52:21 | |
Attachments: | testcase |
Description
Daniel Bonniot
2005-02-17 23:49:12 UTC
Created attachment 8219 [details]
testcase
Well it cannot be really that critial because nobody has hit this before. Confirmed. 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) Daniel, could you post the actual source for those classes? Thanks, Ben Ben -- As I recall the original test case was written in 'nice', not in java. The sources may be of limited usefulness here. This should now be fixed on trunk and 4.1 branch. I tried this today with svn head. The test program still prints 'false' no matter how I run it: gij, compiled, or compiled with the BC ABI. Closing as won't fix as the Java front-end has been removed from the trunk. |