RFR: 8282241: Invalid generic signature for redefined classes [v2]
Serguei Spitsyn
sspitsyn at openjdk.java.net
Wed Mar 16 18:07:54 UTC 2022
On Fri, 4 Mar 2022 17:12:51 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
>> JDK-8238048 (fixed in jdk15) moved major_version, minor_version, generic_signature_index and source_file_name_index from InstanceKlass to ConstantPool.
>> We still have some incorrect code in CP merge during class redefinition.
>>
>> rewrite_cp_refs(scratch_class) updates generic_signature_index and source_file_name_index in the scratch_cp, so we need to copy the attributes (merge_cp->copy_fields(scratch_cp())) after rewrite_cp_refs.
>>
>> In redefine_single_class we don't need to copy source_file_name_index because it's a CP property and we swap CPs. So this copying actually sets the value from old class.
>>
>> tested:
>> - test/jdk/java/lang/instrument
>> - test/hotspot/jtreg/serviceability/jvmti/RedefineClasses
>> - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses
>> - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses
>
> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
>
> Reworked the test
Alex,
The fix looks good. Thank you for taking care about it!
Thanks,
Serguei
-------------
Marked as reviewed by sspitsyn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7676
More information about the hotspot-dev
mailing list