changeset 52580:73f6a850a62f

8213926: WB_EnqueueInitializerForCompilation requests compilation for NULL Reviewed-by: kvn, roland
author iignatyev
date Thu, 15 Nov 2018 14:01:10 -0800
parents fbedca07d49f
children d402a406bbc3
files src/hotspot/share/prims/whitebox.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))