8213926: WB_EnqueueInitializerForCompilation requests compilation for NULL
authoriignatyev
Thu, 15 Nov 2018 14:01:10 -0800
changeset 52580 73f6a850a62f
parent 52579 fbedca07d49f
child 52581 d402a406bbc3
8213926: WB_EnqueueInitializerForCompilation requests compilation for NULL Reviewed-by: kvn, roland
src/hotspot/share/prims/whitebox.cpp
--- a/src/hotspot/share/prims/whitebox.cpp	Thu Nov 15 14:01:08 2018 -0800
+++ b/src/hotspot/share/prims/whitebox.cpp	Thu Nov 15 14:01:10 2018 -0800
@@ -911,7 +911,11 @@
 
 WB_ENTRY(jboolean, WB_EnqueueInitializerForCompilation(JNIEnv* env, jobject o, jclass klass, jint comp_level))
   InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
-  return WhiteBox::compile_method(ik->class_initializer(), comp_level, InvocationEntryBci, THREAD);
+  Method* clinit = ik->class_initializer();
+  if (clinit == NULL) {
+    return false;
+  }
+  return WhiteBox::compile_method(clinit, comp_level, InvocationEntryBci, THREAD);
 WB_END
 
 WB_ENTRY(jboolean, WB_ShouldPrintAssembly(JNIEnv* env, jobject o, jobject method, jint comp_level))