[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:
Simon Pilgrim 2022-01-14 15:51:21 +00:00
parent 9b72e0f9a2
commit f4aa2a42ed
1 changed files with 1 additions and 1 deletions

View File

@ -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);