Skip to content

Commit e19a421

Browse files
committed
8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array'
Reviewed-by: stefank, mdoerr
1 parent 2581935 commit e19a421

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3547,11 +3547,13 @@ void InstanceKlass::print_on(outputStream* st) const {
35473547
}
35483548
}
35493549
st->print(BULLET"method ordering: "); method_ordering()->print_value_on(st); st->cr();
3550-
st->print(BULLET"default_methods: "); default_methods()->print_value_on(st); st->cr();
3551-
if (Verbose && default_methods() != nullptr) {
3552-
Array<Method*>* method_array = default_methods();
3553-
for (int i = 0; i < method_array->length(); i++) {
3554-
st->print("%d : ", i); method_array->at(i)->print_value(); st->cr();
3550+
if (default_methods() != nullptr) {
3551+
st->print(BULLET"default_methods: "); default_methods()->print_value_on(st); st->cr();
3552+
if (Verbose) {
3553+
Array<Method*>* method_array = default_methods();
3554+
for (int i = 0; i < method_array->length(); i++) {
3555+
st->print("%d : ", i); method_array->at(i)->print_value(); st->cr();
3556+
}
35553557
}
35563558
}
35573559
if (default_vtable_indices() != nullptr) {

0 commit comments

Comments
 (0)