8214373: adjust usage of ReleaseLongArrayElements in MacosxDebuggerLocal
Reviewed-by: stuefe, jcbeyler
--- 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, ®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;
}