src/hotspot/share/classfile/classListParser.cpp
changeset 52631 3009ca99de32
parent 52514 f4e3900c8d08
child 53261 b7dca420fa0c
--- a/src/hotspot/share/classfile/classListParser.cpp	Tue Nov 20 18:36:57 2018 -0800
+++ b/src/hotspot/share/classfile/classListParser.cpp	Tue Nov 20 20:00:15 2018 -0800
@@ -389,8 +389,8 @@
     InstanceKlass* ik = InstanceKlass::cast(klass);
     int id = this->id();
     SystemDictionaryShared::update_shared_entry(ik, id);
-    InstanceKlass* old = table()->lookup(id);
-    if (old != NULL && old != ik) {
+    InstanceKlass** old_ptr = table()->lookup(id);
+    if (old_ptr != NULL) {
       error("Duplicated ID %d for class %s", id, _class_name);
     }
     table()->add(id, ik);
@@ -404,11 +404,12 @@
 }
 
 InstanceKlass* ClassListParser::lookup_class_by_id(int id) {
-  InstanceKlass* klass = table()->lookup(id);
-  if (klass == NULL) {
+  InstanceKlass** klass_ptr = table()->lookup(id);
+  if (klass_ptr == NULL) {
     error("Class ID %d has not been defined", id);
   }
-  return klass;
+  assert(*klass_ptr != NULL, "must be");
+  return *klass_ptr;
 }