forked from OSchip/llvm-project
[llvm-profgen] ProfiledBinary::load - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced immediately, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
9b72e0f9a2
commit
f4aa2a42ed
|
@ -206,7 +206,7 @@ void ProfiledBinary::load() {
|
||||||
decodePseudoProbe(Obj);
|
decodePseudoProbe(Obj);
|
||||||
|
|
||||||
// Load debug info of subprograms from DWARF section.
|
// Load debug info of subprograms from DWARF section.
|
||||||
loadSymbolsFromDWARF(*dyn_cast<ObjectFile>(&Binary));
|
loadSymbolsFromDWARF(*cast<ObjectFile>(&Binary));
|
||||||
|
|
||||||
// Disassemble the text sections.
|
// Disassemble the text sections.
|
||||||
disassemble(Obj);
|
disassemble(Obj);
|
||||||
|
|
Loading…
Reference in New Issue