8215395: Allow null oops in Dictionary and JNIHandle verification
authorpliden
Sat, 15 Dec 2018 20:03:06 +0100
changeset 53057 c7ab0761ef88
parent 53056 9041178a0b69
child 53058 83840e83476a
8215395: Allow null oops in Dictionary and JNIHandle verification Reviewed-by: eosterlund, kbarrett, coleenp
src/hotspot/share/classfile/dictionary.hpp
src/hotspot/share/runtime/jniHandles.cpp
--- a/src/hotspot/share/classfile/dictionary.hpp	Fri Dec 14 19:39:39 2018 -0800
+++ b/src/hotspot/share/classfile/dictionary.hpp	Sat Dec 15 20:03:06 2018 +0100
@@ -173,7 +173,7 @@
     for (ProtectionDomainEntry* current = pd_set(); // accessed at a safepoint
                                 current != NULL;
                                 current = current->_next) {
-      guarantee(oopDesc::is_oop(current->_pd_cache->object_no_keepalive()), "Invalid oop");
+      guarantee(oopDesc::is_oop_or_null(current->_pd_cache->object_no_keepalive()), "Invalid oop");
     }
   }
 
--- a/src/hotspot/share/runtime/jniHandles.cpp	Fri Dec 14 19:39:39 2018 -0800
+++ b/src/hotspot/share/runtime/jniHandles.cpp	Sat Dec 15 20:03:06 2018 +0100
@@ -318,7 +318,7 @@
 class VerifyJNIHandles: public OopClosure {
 public:
   virtual void do_oop(oop* root) {
-    guarantee(oopDesc::is_oop(RawAccess<>::oop_load(root)), "Invalid oop");
+    guarantee(oopDesc::is_oop_or_null(RawAccess<>::oop_load(root)), "Invalid oop");
   }
   virtual void do_oop(narrowOop* root) { ShouldNotReachHere(); }
 };