# HG changeset patch # User mbaesken # Date 1543330570 -3600 # Tue Nov 27 15:56:10 2018 +0100 # Node ID 326020b7bea92c2fc73d4c24d47e5e145e81a81e # Parent b80549fdb52fa17944c25c21559e4edfe342537c 8214373: adjust usage of ReleaseLongArrayElements in MacosxDebuggerLocal diff --git a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m --- a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m +++ b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m @@ -441,6 +441,7 @@ for (i = 0; i < n; i++) { if (!get_nth_lwp_regs(ph, i, ®s)) { 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; }