8223262: [AOT] jaotc crashes with assert(!(((ThreadShadow*)__the_thread__)->has_pending_exception())) failed: Should not allocate with exception pending
authorkvn
Fri, 03 May 2019 09:07:30 -0700
changeset 54708 b7e6fc77c2f3
parent 54707 8390399b09f9
child 54709 90855d9c3c39
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
src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
--- 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);