Skip to content

Commit 3aa07db

Browse files
author
Matias Saavedra Silva
committed
8343890: SEGV crash in RunTimeClassInfo::klass
Reviewed-by: ccheung Backport-of: bf0debc
1 parent 85fedbf commit 3aa07db

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/hotspot/share/cds/runTimeClassInfo.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ void RunTimeClassInfo::init(DumpTimeClassInfo& info) {
7676
}
7777

7878
InstanceKlass* RunTimeClassInfo::klass() const {
79-
if (ArchiveBuilder::is_active() && ArchiveBuilder::current()->is_in_buffer_space((address)this)) {
80-
return ArchiveBuilder::current()->offset_to_buffered<InstanceKlass*>(_klass_offset);
81-
} else {
79+
if (MetaspaceShared::is_in_shared_metaspace(this)) {
80+
// <this> is inside a mmaped CDS archive.
8281
return ArchiveUtils::offset_to_archived_address<InstanceKlass*>(_klass_offset);
82+
} else {
83+
// <this> is a temporary copy of a RunTimeClassInfo that's being initialized
84+
// by the ArchiveBuilder.
85+
return ArchiveBuilder::current()->offset_to_buffered<InstanceKlass*>(_klass_offset);
8386
}
8487
}
8588

0 commit comments

Comments
 (0)