提交 e6c096aa 编写于 作者: D dcubed

6547500: 2/2 j.l.i.: .retransformClasses throws unexpected InternalError

Summary: retransformClasses() should catch both an empty classes array and a classes array that contains a NULL element.
Reviewed-by: ohair, sspitsyn
上级 7cd6ae62
......@@ -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;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册