forked from OSchip/llvm-project
[llvm-profgen] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointers are dereferenced immediately, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
9fd9d56dc6
commit
c56a85fde0
|
@ -211,9 +211,9 @@ void ProfiledBinary::load() {
|
||||||
if (!DebugBinaryPath.empty()) {
|
if (!DebugBinaryPath.empty()) {
|
||||||
OwningBinary<Binary> DebugPath =
|
OwningBinary<Binary> DebugPath =
|
||||||
unwrapOrError(createBinary(DebugBinaryPath), DebugBinaryPath);
|
unwrapOrError(createBinary(DebugBinaryPath), DebugBinaryPath);
|
||||||
loadSymbolsFromDWARF(*dyn_cast<ObjectFile>(DebugPath.getBinary()));
|
loadSymbolsFromDWARF(*cast<ObjectFile>(DebugPath.getBinary()));
|
||||||
} else {
|
} else {
|
||||||
loadSymbolsFromDWARF(*dyn_cast<ObjectFile>(&ExeBinary));
|
loadSymbolsFromDWARF(*cast<ObjectFile>(&ExeBinary));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disassemble the text sections.
|
// Disassemble the text sections.
|
||||||
|
|
Loading…
Reference in New Issue