RFR: 8268720: Unspecified checks on NameAndType constants should not be performed [v4]
Harold Seigel
hseigel at openjdk.java.net
Mon Jun 21 17:11:05 UTC 2021
> Please review this small fix for JDK-8268720. The fix changes the JVM to no longer throw a ClassFormatError exception for a constant pool NameAndType that has a name and descriptor that are both valid, but are incompatible together, such as "<init>()D".
>
> Note that if the CONSTANT_NameAndType_info for a CONSTANT_Methodref_info contained the name "<init>"and descriptor such as "()D" then a ClassFormatError exception would get thrown because the CONSTANT_Methodref_info would be invalid. JVM Spec section 4.4.2 says:
>
> If the name of the method in a CONSTANT_Methodref_info structure begins with a '<' ('\u003c'), then the name must be the special name <init>, representing an instance initialization method (§2.9.1). The return type of such a method must be void.
>
> The fix was tested with Mach5 tiers 1 and 2 on Linux, Mac OS, and Windows, Mach5 tiers 3-5 on Linux x64, and JCK Lang and VM tests on Linux x64.
>
> Thanks, Harold
Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
split verify_legal_method_signature() into two methods
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/4497/files
- new: https://git.openjdk.java.net/jdk/pull/4497/files/0d063d6b..b42efc40
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4497&range=03
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4497&range=02-03
Stats: 60 lines in 2 files changed: 32 ins; 20 del; 8 mod
Patch: https://git.openjdk.java.net/jdk/pull/4497.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/4497/head:pull/4497
PR: https://git.openjdk.java.net/jdk/pull/4497
More information about the hotspot-runtime-dev
mailing list