RFR: 8350029: Illegal invokespecial interface not caught by verification

Coleen Phillimore coleenp at openjdk.org
Wed Jun 4 20:14:52 UTC 2025


On Fri, 30 May 2025 06:31:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

> As described in the JBS problem statement there was a missing verification check for bad `invokespecial` call, though it did result in a runtime exception. That gap has now been closed by checking if the target of the invocation is an interface type, which we can check when the type gets loaded as part of the assignability check.
> 
> The existing code was very difficult to follow so I have added significant commentary in the verifier. I also improved the naming in the assignability checking code to make it easier to follow. Finally, the existing linkage error was using an incorrect error message to describe the problem it was encountering.
> 
> Testing:
>  - new test case
>  - tiers 1-3
> 
> Thanks

Looks good, apart from a couple of file format errors that jcheck doesn't apparently catch.

test/hotspot/jtreg/runtime/verifier/invokespecial/UseInterfaceMethodRef.jasm line 37:

> 35:         return;
> 36:     }
> 37: }

end of file is funny here.

test/hotspot/jtreg/runtime/verifier/invokespecial/UseMethodRef.jasm line 37:

> 35:         return;
> 36:     }
> 37: }

end of file also broken here.

-------------

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25538#pullrequestreview-2897978478
PR Review Comment: https://git.openjdk.org/jdk/pull/25538#discussion_r2127359997
PR Review Comment: https://git.openjdk.org/jdk/pull/25538#discussion_r2127360392


More information about the hotspot-runtime-dev mailing list