Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions hotspot/src/share/vm/oops/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1903,9 +1903,6 @@ bool Method::is_method_id(jmethodID mid) {

Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
if (mid == NULL) return NULL;
if (!Method::is_method_id(mid)) {
return NULL;
}
Method* o = resolve_jmethod_id(mid);
if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
return NULL;
Expand Down
5 changes: 5 additions & 0 deletions hotspot/src/share/vm/prims/jniCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ Method* jniCheck::validate_jmethod_id(JavaThread* thr, jmethodID method_id) {
if (moop == NULL) {
ReportJNIFatalError(thr, fatal_wrong_class_or_method);
}
// jmethodIDs are supposed to be weak handles in the class loader data,
// but that can be expensive so check it last
else if (!Method::is_method_id(method_id)) {
ReportJNIFatalError(thr, fatal_non_weak_method);
}
return moop;
}

Expand Down