8213926: WB_EnqueueInitializerForCompilation requests compilation for NULL
Reviewed-by: kvn, roland
--- 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))