8191852: Null pointer dereference in ciKlass::get_Klass of ciKlass.hpp:58
authordlong
Fri, 22 Dec 2017 22:01:53 -0800
changeset 48417 044979e94c4e
parent 48416 08144d9cbdaa
child 48418 2207e2917a68
8191852: Null pointer dereference in ciKlass::get_Klass of ciKlass.hpp:58 Reviewed-by: kvn
src/hotspot/share/ci/ciField.cpp
--- a/src/hotspot/share/ci/ciField.cpp	Fri Dec 22 18:49:41 2017 +0000
+++ b/src/hotspot/share/ci/ciField.cpp	Fri Dec 22 22:01:53 2017 -0800
@@ -234,7 +234,9 @@
   // Get the flags, offset, and canonical holder of the field.
   _flags = ciFlags(fd->access_flags());
   _offset = fd->offset();
-  _holder = CURRENT_ENV->get_instance_klass(fd->field_holder());
+  Klass* field_holder = fd->field_holder();
+  assert(field_holder != NULL, "null field_holder");
+  _holder = CURRENT_ENV->get_instance_klass(field_holder);
 
   // Check to see if the field is constant.
   Klass* k = _holder->get_Klass();