--- old/src/hotspot/share/prims/jniCheck.cpp 2018-01-02 18:27:22.593218296 -0500 +++ new/src/hotspot/share/prims/jniCheck.cpp 2018-01-02 18:27:22.261201163 -0500 @@ -1930,6 +1930,13 @@ checked_jni_DeleteWeakGlobalRef(JNIEnv *env, jweak ref)) functionEnterExceptionAllowed(thr); + IN_VM( + jniCheck::validate_object(thr, ref); + if (ref && !JNIHandles::is_weak_global_handle(ref)) { + ReportJNIFatalError(thr, + "Invalid weak global JNI handle passed to DeleteWeakGlobalRef"); + } + ) UNCHECKED()->DeleteWeakGlobalRef(env, ref); functionExit(thr); JNI_END