Skip to content

Commit 5acff75

Browse files
eastigVladimir Kozlov
authored andcommitted
8276429: CodeHeapState::print_names() fails with "assert(klass->is_loader_alive()) failed: must be alive"
Reviewed-by: kvn
1 parent a6fa6ed commit 5acff75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hotspot/share/code/codeHeapState.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -2335,11 +2335,11 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
23352335
Symbol* methSig = method->signature();
23362336
const char* methSigS = (methSig == NULL) ? NULL : methSig->as_C_string();
23372337
methSigS = (methSigS == NULL) ? "<method signature unavailable>" : methSigS;
2338-
23392338
Klass* klass = method->method_holder();
2340-
assert(klass->is_loader_alive(), "must be alive");
2339+
assert(klass != nullptr, "No method holder");
2340+
const char* classNameS = (klass->name() == nullptr) ? "<class name unavailable>" : klass->external_name();
23412341

2342-
ast->print("%s.", klass->external_name());
2342+
ast->print("%s.", classNameS);
23432343
ast->print("%s", methNameS);
23442344
ast->print("%s", methSigS);
23452345
} else {

0 commit comments

Comments
 (0)