8214373: adjust usage of ReleaseLongArrayElements in MacosxDebuggerLocal
authormbaesken
Tue, 27 Nov 2018 15:56:10 +0100
changeset 52713 8586613959f0
parent 52712 d17e09494308
child 52714 2e52aa822c57
8214373: adjust usage of ReleaseLongArrayElements in MacosxDebuggerLocal Reviewed-by: stuefe, jcbeyler
src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
--- 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;
 }