Skip to content

Commit

Permalink
8276429: CodeHeapState::print_names() fails with "assert(klass->is_lo…
Browse files Browse the repository at this point in the history
…ader_alive()) failed: must be alive"

Reviewed-by: kvn
  • Loading branch information
eastig authored and Vladimir Kozlov committed Nov 4, 2021
1 parent a6fa6ed commit 5acff75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/share/code/codeHeapState.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -2335,11 +2335,11 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
Symbol* methSig = method->signature();
const char* methSigS = (methSig == NULL) ? NULL : methSig->as_C_string();
methSigS = (methSigS == NULL) ? "<method signature unavailable>" : methSigS;

Klass* klass = method->method_holder();
assert(klass->is_loader_alive(), "must be alive");
assert(klass != nullptr, "No method holder");
const char* classNameS = (klass->name() == nullptr) ? "<class name unavailable>" : klass->external_name();

ast->print("%s.", klass->external_name());
ast->print("%s.", classNameS);
ast->print("%s", methNameS);
ast->print("%s", methSigS);
} else {
Expand Down

1 comment on commit 5acff75

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