8189633: Missing -Xcheck:jni checking for DeleteWeakGlobalRef
Added validity check on the handle before deleting it. Reviewed-by: dholmes, dcubed
This commit is contained in:
parent
1acad37ee6
commit
1e1d9319dc
@ -1927,6 +1927,12 @@ JNI_ENTRY_CHECKED(void,
|
||||
checked_jni_DeleteWeakGlobalRef(JNIEnv *env,
|
||||
jweak ref))
|
||||
functionEnterExceptionAllowed(thr);
|
||||
IN_VM(
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user