Fix a warning about ‘r_type’ may be used uninitialized.
[oota-llvm.git] / tools / llvm-objdump / MachODump.cpp
index 4129e99cf9d2526bda1f16f2446f30981a938338..8bc89174440cfd7df8823b44c5d85291c779aa0c 100644 (file)
@@ -346,10 +346,10 @@ int SymbolizerGetOpInfo(void *DisInfo, uint64_t Pc, uint64_t Offset,
       if (RelocOffset == sect_offset) {
         Rel = Reloc.getRawDataRefImpl();
         RE = info->O->getRelocation(Rel);
+        r_type = info->O->getAnyRelocationType(RE);
         r_scattered = info->O->isRelocationScattered(RE);
         if (r_scattered) {
           r_value = info->O->getScatteredRelocationValue(RE);
-          r_type = info->O->getScatteredRelocationType(RE);
           if (r_type == MachO::GENERIC_RELOC_SECTDIFF ||
               r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF) {
             DataRefImpl RelNext = Rel;