forked from OSchip/llvm-project
[llvm-objdump] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointers are always dereferenced immediately, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
a4f2025492
commit
ff05b93a02
|
@ -10231,12 +10231,12 @@ static void PrintMachHeader(const MachOObjectFile *Obj, bool verbose) {
|
|||
}
|
||||
|
||||
void objdump::printMachOFileHeader(const object::ObjectFile *Obj) {
|
||||
const MachOObjectFile *file = dyn_cast<const MachOObjectFile>(Obj);
|
||||
const MachOObjectFile *file = cast<const MachOObjectFile>(Obj);
|
||||
PrintMachHeader(file, Verbose);
|
||||
}
|
||||
|
||||
void objdump::printMachOLoadCommands(const object::ObjectFile *Obj) {
|
||||
const MachOObjectFile *file = dyn_cast<const MachOObjectFile>(Obj);
|
||||
const MachOObjectFile *file = cast<const MachOObjectFile>(Obj);
|
||||
uint32_t filetype = 0;
|
||||
uint32_t cputype = 0;
|
||||
if (file->is64Bit()) {
|
||||
|
|
Loading…
Reference in New Issue