8046662: Check JNI ReleaseStringChars / ReleaseStringUTFChars verify_guards test inverted
authordsimms
Thu, 12 Jun 2014 11:34:35 +0200
changeset 25059 fff9b51f4be4
parent 25058 4542f853c2ac
child 25060 fab862c73f1c
8046662: Check JNI ReleaseStringChars / ReleaseStringUTFChars verify_guards test inverted Summary: negative verify_guards when testing for corruption Reviewed-by: sla, fparain
hotspot/src/share/vm/prims/jniCheck.cpp
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Wed Jun 11 18:34:09 2014 +0200
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Thu Jun 12 11:34:35 2014 +0200
@@ -1493,7 +1493,7 @@
     }
     else {
       GuardedMemory guarded((void*)chars);
-      if (guarded.verify_guards()) {
+      if (!guarded.verify_guards()) {
         tty->print_cr("ReleaseStringChars: release chars failed bounds check. "
             "string: " PTR_FORMAT " chars: " PTR_FORMAT, p2i(str), p2i(chars));
         guarded.print_on(tty);
@@ -1576,7 +1576,7 @@
     }
     else {
       GuardedMemory guarded((void*)chars);
-      if (guarded.verify_guards()) {
+      if (!guarded.verify_guards()) {
         tty->print_cr("ReleaseStringUTFChars: release chars failed bounds check. "
             "string: " PTR_FORMAT " chars: " PTR_FORMAT, p2i(str), p2i(chars));
         guarded.print_on(tty);