< prev index next >

src/hotspot/share/oops/klass.cpp

Print this page
@@ -512,11 +512,10 @@
      ResourceMark rm;
      log_trace(cds)("Iter(Klass): %p (%s)", this, external_name());
    }
  
    it->push(&_name);
-   it->push(&_secondary_super_cache);
    it->push(&_secondary_supers);
    for (int i = 0; i < _primary_super_limit; i++) {
      it->push(&_primary_supers[i]);
    }
    it->push(&_super);

@@ -543,10 +542,15 @@
    if (log_is_enabled(Trace, cds, unshareable)) {
      ResourceMark rm;
      log_trace(cds, unshareable)("remove: %s", external_name());
    }
  
+   // _secondary_super_cache may be updated by an is_subtype_of() call
+   // while ArchiveBuilder is copying metaspace objects. Let's reset it to
+   // null and let it be repopulated at runtime.
+   set_secondary_super_cache(nullptr);
+ 
    set_subklass(nullptr);
    set_next_sibling(nullptr);
    set_next_link(nullptr);
  
    // Null out class_loader_data because we don't share that yet.
< prev index next >