Skip to content

Commit

Permalink
8275049: [ZGC] missing null check in ZNMethod::log_register
Browse files Browse the repository at this point in the history
Backport-of: cf828673a9b76fd3f26db9a3f714166861a65c9e
  • Loading branch information
TheRealMDoerr committed Oct 18, 2021
1 parent 451611f commit 8cb9634
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/z/zNMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ void ZNMethod::log_register(const nmethod* nm) {
oop* const begin = nm->oops_begin();
oop* const end = nm->oops_end();
for (oop* p = begin; p < end; p++) {
const oop o = Atomic::load(p); // C1 PatchingStub may replace it concurrently.
const char* external_name = (o == nullptr) ? "N/A" : o->klass()->external_name();
log_oops.print(" Oop[" SIZE_FORMAT "] " PTR_FORMAT " (%s)",
(p - begin), p2i(*p), (*p)->klass()->external_name());
(p - begin), p2i(o), external_name);
}
}

Expand Down

1 comment on commit 8cb9634

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.