mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
6547500: 2/2 j.l.i.: .retransformClasses throws unexpected InternalError
RetransformClasses() should catch both an empty classes array and a classes array that contains a NULL element. Reviewed-by: ohair, sspitsyn
This commit is contained in:
parent
b6cb4857d9
commit
f465e85260
1 changed files with 13 additions and 0 deletions
|
@ -1076,6 +1076,12 @@ retransformClasses(JNIEnv * jnienv, JPLISAgent * agent, jobjectArray classes) {
|
|||
numClasses = (*jnienv)->GetArrayLength(jnienv, classes);
|
||||
errorOccurred = checkForThrowable(jnienv);
|
||||
jplis_assert(!errorOccurred);
|
||||
|
||||
if (!errorOccurred && numClasses == 0) {
|
||||
jplis_assert(numClasses != 0);
|
||||
errorOccurred = JNI_TRUE;
|
||||
errorCode = JVMTI_ERROR_NULL_POINTER;
|
||||
}
|
||||
}
|
||||
|
||||
if (!errorOccurred) {
|
||||
|
@ -1097,6 +1103,13 @@ retransformClasses(JNIEnv * jnienv, JPLISAgent * agent, jobjectArray classes) {
|
|||
if (errorOccurred) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (classArray[index] == NULL) {
|
||||
jplis_assert(classArray[index] != NULL);
|
||||
errorOccurred = JNI_TRUE;
|
||||
errorCode = JVMTI_ERROR_NULL_POINTER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue