src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
changeset 52713 8586613959f0
parent 50818 e46b9e514479
child 58017 9726449d2644
--- a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m	Tue Nov 27 14:49:13 2018 +0100
+++ b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m	Tue Nov 27 15:56:10 2018 +0100
@@ -441,6 +441,7 @@
   for (i = 0; i < n; i++) {
     if (!get_nth_lwp_regs(ph, i, &regs)) {
       print_debug("Could not get regs of thread %d, already set!\n", i);
+      (*env)->ReleaseLongArrayElements(env, thrinfos, (jlong*)cinfos, 0);
       return false;
     }
     for (j = 0; j < len; j += 3) {
@@ -519,8 +520,8 @@
   regs[REG_INDEX(TRAPNO)] = gregs.r_trapno;
   regs[REG_INDEX(RFL)]    = gregs.r_rflags;
 
+  (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
 #endif /* amd64 */
-  (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
   return array;
 }