Skip to content

Commit 93d4ad4

Browse files
committed
8344763: cpCache print_on doesn't handle nulls
Reviewed-by: matsaave
1 parent dc9a6ef commit 93d4ad4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/hotspot/share/oops/cpCache.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,15 @@ oop ConstantPoolCache::appendix_if_resolved(ResolvedMethodEntry* method_entry) c
829829
void ConstantPoolCache::print_on(outputStream* st) const {
830830
st->print_cr("%s", internal_name());
831831
// print constant pool cache entries
832-
print_resolved_field_entries(st);
833-
print_resolved_method_entries(st);
834-
print_resolved_indy_entries(st);
832+
if (_resolved_field_entries != nullptr) {
833+
print_resolved_field_entries(st);
834+
}
835+
if (_resolved_method_entries != nullptr) {
836+
print_resolved_method_entries(st);
837+
}
838+
if (_resolved_indy_entries != nullptr) {
839+
print_resolved_indy_entries(st);
840+
}
835841
}
836842

837843
void ConstantPoolCache::print_resolved_field_entries(outputStream* st) const {

0 commit comments

Comments
 (0)