JDK-8026065 : InterfaceMethodref for invokespecial must name a direct superinterface
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs25
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-10-08
  • Updated: 2025-05-06
  • Resolved: 2013-11-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8Fixed hs25Fixed
Related Reports
Blocks :  
Description
Given an invokespecial of the form:

invokespecial I.m()V

Where I is an interface, it must be the case that the calling class/interface has I as a direct superinterface.  See Lambda Spec, 0.6.3, Part J, 4.9.2.

I have been told that HotSpot currently allows a reference to an indirect superinterface.  This should be prohibited, just like references to methods in classes unrelated to the calling class.
Comments
URL: http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/22eaa15b7960 User: amurillo Date: 2013-11-29 22:05:04 +0000
29-11-2013

URL: http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/22eaa15b7960 User: hseigel Date: 2013-11-26 16:49:18 +0000
26-11-2013

Release team: Approved for fixing
25-11-2013

Fix commit pending the review of the 4 JCK lang failures. See JDK-8027281.
24-10-2013

Read the spec really carefully, interfacemethodref for invokespecial (JVMS draft 0.63) 4.9.2 Structural Constraints Each invokespecial instruction must name an instance initialization method (2.0) or must reference a method in the current class or interface, a method in a superclass of the current class or interface, or a method in a direct superinterface of the current class or interface'. The change this bug is for is to ensure that 1) if not init 2) if not current class or interface 3) method is either in any superclass 4) OR method is in a DIRECT superinterface of current class/interface <--- i.e. it is already ok to be in ANY superclass, not just direct
11-10-2013

Make sure you run the test attached to 8026213 (check with Karen on this - I have a jdk with the required patch applied) to ensure that reflection still works correctly
09-10-2013

Need a verifier error if not a direct superinterface, should be similar to the not a supertype. For those who skip verification, should be handled the same as a not supertype according to Dan. Verifier change: this is only for verifier.cpp, you will only see this in classfile 52, earlier versions won't take interfacemethodref at all for invokespecial so you don't have to do a version check, and you don't need to change the old verifier. See linkResolver.cpp for the invokespecial handling if you skip verification.
08-10-2013