Skip to content

Commit

Permalink
8293012: ConstantPool::print_on can crash if _cache is NULL
Browse files Browse the repository at this point in the history
Backport-of: 9424d6d487db4ad0f6f671a8c33b8f169794fe25
  • Loading branch information
shipilev committed Jun 20, 2023
1 parent fb1741c commit 2e5a402
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hotspot/share/oops/constantPool.cpp
Expand Up @@ -2244,9 +2244,10 @@ void ConstantPool::print_on(outputStream* st) const {
st->print_cr(" - holder: " INTPTR_FORMAT, p2i(pool_holder()));
}
st->print_cr(" - cache: " INTPTR_FORMAT, p2i(cache()));
st->print_cr(" - resolved_references: " INTPTR_FORMAT, p2i(resolved_references()));
st->print_cr(" - resolved_references: " INTPTR_FORMAT, p2i(resolved_references_or_null()));
st->print_cr(" - reference_map: " INTPTR_FORMAT, p2i(reference_map()));
st->print_cr(" - resolved_klasses: " INTPTR_FORMAT, p2i(resolved_klasses()));
st->print_cr(" - cp length: %d", length());

for (int index = 1; index < length(); index++) { // Index 0 is unused
((ConstantPool*)this)->print_entry_on(index, st);
Expand Down

1 comment on commit 2e5a402

@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.