8223262: [AOT] jaotc crashes with assert(!(((ThreadShadow*)__the_thread__)->has_pending_exception())) failed: Should not allocate with exception pending
Summary: Added missing checks for pending exception.
Reviewed-by: never, gdub, dnsimon
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Fri May 03 16:31:11 2019 +0200
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Fri May 03 09:07:30 2019 -0700
@@ -557,7 +557,10 @@
Klass* klass = cp->klass_at(index, CHECK_NULL);
JVMCIKlassHandle resolved_klass(THREAD, klass);
if (resolved_klass->is_instance_klass()) {
- InstanceKlass::cast(resolved_klass())->link_class_or_fail(THREAD);
+ bool linked = InstanceKlass::cast(resolved_klass())->link_class_or_fail(CHECK_NULL);
+ if (!linked) {
+ return NULL;
+ }
}
JVMCIObject klassObject = JVMCIENV->get_jvmci_type(resolved_klass, JVMCI_CHECK_NULL);
return JVMCIENV->get_jobject(klassObject);