Commit ff05b93a authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[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
parent a4f20254
......@@ -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()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment