JBR-5183 fix assert in make_jmethod_id

This commit is contained in:
Vladimir Dvorak
2023-02-04 17:08:10 +01:00
committed by Vitaly Provodin
parent 7a44b5eb6a
commit 3229e3a7c9

View File

@@ -2182,7 +2182,7 @@ jmethodID Method::make_jmethod_id(ClassLoaderData* cld, Method* m) {
// Have to add jmethod_ids() to class loader data thread-safely.
// Also have to add the method to the list safely, which the lock
// protects as well.
assert(JmethodIdCreation_lock->owned_by_self(), "sanity check");
assert(AllowEnhancedClassRedefinition || JmethodIdCreation_lock->owned_by_self(), "sanity check");
if (AllowEnhancedClassRedefinition && m != m->newest_version()) {
m = m->newest_version();
}