diff options
Diffstat (limited to 'tools/llvm-readobj/MachODumper.cpp')
-rw-r--r-- | tools/llvm-readobj/MachODumper.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/llvm-readobj/MachODumper.cpp b/tools/llvm-readobj/MachODumper.cpp index 54de49c..10e53d9 100644 --- a/tools/llvm-readobj/MachODumper.cpp +++ b/tools/llvm-readobj/MachODumper.cpp @@ -406,12 +406,11 @@ void MachODumper::printSymbol(symbol_iterator SymI) { MachOSymbol Symbol; getSymbol(Obj, SymI->getRawDataRefImpl(), Symbol); - StringRef SectionName; + StringRef SectionName = ""; section_iterator SecI(Obj->end_sections()); - if (error(SymI->getSection(SecI)) || - SecI == Obj->end_sections() || - error(SecI->getName(SectionName))) - SectionName = ""; + if (!error(SymI->getSection(SecI)) && + SecI != Obj->end_sections()) + error(SecI->getName(SectionName)); DictScope D(W, "Symbol"); W.printNumber("Name", SymbolName, Symbol.StringIndex); |