changeset 140:ba825e4b1b8b

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
author dcubed
date Mon, 24 Mar 2008 16:32:15 -0700
parents 719789c7132c
children 823abb444593
files src/share/instrument/JPLISAgent.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/instrument/JPLISAgent.c	Mon Mar 24 16:23:21 2008 -0700
+++ b/src/share/instrument/JPLISAgent.c	Mon Mar 24 16:32:15 2008 -0700
@@ -1076,6 +1076,12 @@
         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 @@
             if (errorOccurred) {
                 break;
             }
+
+            if (classArray[index] == NULL) {
+                jplis_assert(classArray[index] != NULL);
+                errorOccurred = JNI_TRUE;
+                errorCode = JVMTI_ERROR_NULL_POINTER;
+                break;
+            }
         }
     }