diff --git a/lib/DebugInfo/DWARF/DWARFContext.cpp b/lib/DebugInfo/DWARF/DWARFContext.cpp index ce5c4ae89e8..cbce2dc89de 100644 --- a/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -667,11 +667,11 @@ static Expected getSymbolAddress(const object::ObjectFile &Obj, static bool isRelocScattered(const object::ObjectFile &Obj, const RelocationRef &Reloc) { - if (!isa(&Obj)) + const MachOObjectFile *MachObj = dyn_cast(&Obj); + if (!MachObj) return false; // MachO also has relocations that point to sections and // scattered relocations. - const MachOObjectFile *MachObj = cast(&Obj); auto RelocInfo = MachObj->getRelocation(Reloc.getRawDataRefImpl()); return MachObj->isRelocationScattered(RelocInfo); }