From 679f30ebc32d75760cbe7e1d3d37ea8997e6577b Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 27 Nov 2018 15:56:10 +0100 Subject: [PATCH] 8214373: adjust usage of ReleaseLongArrayElements in MacosxDebuggerLocal Reviewed-by: stuefe, jcbeyler --- .../macosx/native/libsaproc/MacosxDebuggerLocal.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m index e2fa2fc47b5..1c3cda1537f 100644 --- a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m +++ b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m @@ -441,6 +441,7 @@ bool fill_java_threads(JNIEnv* env, jobject this_obj, struct ps_prochandle* ph) 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 @@ jlongArray getThreadIntegerRegisterSetFromCore(JNIEnv *env, jobject this_obj, lo regs[REG_INDEX(TRAPNO)] = gregs.r_trapno; regs[REG_INDEX(RFL)] = gregs.r_rflags; -#endif /* amd64 */ (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); +#endif /* amd64 */ return array; }