8232120: com/sun/jdi/InvokeTest fails with -Xcheck:jni: assert(k->is_instance_klass()) failed: cast to InstanceKlass
authorcoleenp
Fri, 11 Oct 2019 11:50:04 -0400
changeset 58562 e43ac61b89ab
parent 58561 3968bf3673c5
child 58563 78bbb5dde2a3
8232120: com/sun/jdi/InvokeTest fails with -Xcheck:jni: assert(k->is_instance_klass()) failed: cast to InstanceKlass Summary: Should have allowed recv klass to be an array. Reviewed-by: hseigel, dcubed
src/hotspot/share/prims/jniCheck.cpp
--- a/src/hotspot/share/prims/jniCheck.cpp	Thu Oct 10 10:28:55 2019 +0100
+++ b/src/hotspot/share/prims/jniCheck.cpp	Fri Oct 11 11:50:04 2019 -0400
@@ -534,10 +534,10 @@
   if (obj != NULL) {
     oop recv = jniCheck::validate_object(thr, obj);
     assert(recv != NULL, "validate_object checks that");
-    Klass* ik = recv->klass();
+    Klass* rk = recv->klass();
 
     // Check that the object is a subtype of method holder too.
-    if (!InstanceKlass::cast(ik)->is_subtype_of(holder)) {
+    if (!rk->is_subtype_of(holder)) {
       ReportJNIFatalError(thr, fatal_wrong_class_or_method);
     }
   }