changeset 52736:8586613959f0

8214373: adjust usage of ReleaseLongArrayElements in MacosxDebuggerLocal Reviewed-by: stuefe, jcbeyler
author mbaesken
date Tue, 27 Nov 2018 15:56:10 +0100
parents d17e09494308
children 2e52aa822c57
files src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }