Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
if (mid == NULL) return NULL;
Method* o = resolve_jmethod_id(mid);
if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
return NULL;
}
return o;
};
We could, in addition, test that:
- Method* is a valid metaspace pointer
- Method* is a method
see Metaspace::contains() and Method::is_valid_method(), respectively.
Can be done either unconditionally, or at least as assert, if it costs too much time.
if (mid == NULL) return NULL;
Method* o = resolve_jmethod_id(mid);
if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
return NULL;
}
return o;
};
We could, in addition, test that:
- Method* is a valid metaspace pointer
- Method* is a method
see Metaspace::contains() and Method::is_valid_method(), respectively.
Can be done either unconditionally, or at least as assert, if it costs too much time.
- duplicates
-
JDK-8268364 jmethod clearing should be done during unloading
- Resolved
- relates to
-
JDK-8181110 jvmti/hotswap test crashes in Method::checked_resolve_jmethod_id(_jmethodID*)
- Closed
-
JDK-8227410 jvmti/scenarios/hotswap/HS101/hs101t005 crashes with SIGSEGV
- Closed