Skip to content

Commit 8cb9634

Browse files
committed
8275049: [ZGC] missing null check in ZNMethod::log_register
Backport-of: cf828673a9b76fd3f26db9a3f714166861a65c9e
1 parent 451611f commit 8cb9634

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hotspot/share/gc/z/zNMethod.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ void ZNMethod::log_register(const nmethod* nm) {
126126
oop* const begin = nm->oops_begin();
127127
oop* const end = nm->oops_end();
128128
for (oop* p = begin; p < end; p++) {
129+
const oop o = Atomic::load(p); // C1 PatchingStub may replace it concurrently.
130+
const char* external_name = (o == nullptr) ? "N/A" : o->klass()->external_name();
129131
log_oops.print(" Oop[" SIZE_FORMAT "] " PTR_FORMAT " (%s)",
130-
(p - begin), p2i(*p), (*p)->klass()->external_name());
132+
(p - begin), p2i(o), external_name);
131133
}
132134
}
133135

0 commit comments

Comments
 (0)