[llvm] 838a955 - [readobj] Fix dangling else warning

Kadir Cetinkaya via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 03:55:36 PDT 2020


Author: Kadir Cetinkaya
Date: 2020-05-29T12:55:25+02:00
New Revision: 838a955ab9c79f906ef936fc0100f94cae71a83c

URL: https://github.com/llvm/llvm-project/commit/838a955ab9c79f906ef936fc0100f94cae71a83c
DIFF: https://github.com/llvm/llvm-project/commit/838a955ab9c79f906ef936fc0100f94cae71a83c.diff

LOG: [readobj] Fix dangling else warning

Added: 
    

Modified: 
    llvm/tools/llvm-readobj/ELFDumper.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index eebe65f8400f..dc080c8dd49c 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -4693,11 +4693,12 @@ void GNUStyle<ELFT>::printHashHistograms(const ELFFile<ELFT> *Obj) {
       printHashHistogram(*HashTable);
 
   // Print histogram for the .gnu.hash section.
-  if (const Elf_GnuHash *GnuHashTable = this->dumper()->getGnuHashTable())
+  if (const Elf_GnuHash *GnuHashTable = this->dumper()->getGnuHashTable()) {
     if (Error E = checkGNUHashTable<ELFT>(Obj, GnuHashTable))
       this->reportUniqueWarning(std::move(E));
     else
       printGnuHashHistogram(*GnuHashTable);
+  }
 }
 
 template <class ELFT>


        


More information about the llvm-commits mailing list