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
--- 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);
}
}