8215395: Allow null oops in Dictionary and JNIHandle verification
Reviewed-by: eosterlund, kbarrett, coleenp
--- 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(); }
};