[llvm] r253529 - Fix UMR in llvm-nm on IR object files in printDarwinSymbol
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 16:51:50 PST 2015
Author: rnk
Date: Wed Nov 18 18:51:50 2015
New Revision: 253529
URL: http://llvm.org/viewvc/llvm-project?rev=253529&view=rev
Log:
Fix UMR in llvm-nm on IR object files in printDarwinSymbol
Modified:
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=253529&r1=253528&r2=253529&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Wed Nov 18 18:51:50 2015
@@ -239,9 +239,8 @@ static void darwinPrintSymbol(SymbolicFi
const char *printDashes, const char *printFormat) {
MachO::mach_header H;
MachO::mach_header_64 H_64;
- uint32_t Filetype, Flags;
- MachO::nlist_64 STE_64;
- MachO::nlist STE;
+ uint32_t Filetype = MachO::MH_OBJECT;
+ uint32_t Flags = 0;
uint8_t NType = 0;
uint8_t NSect = 0;
uint16_t NDesc = 0;
@@ -280,7 +279,7 @@ static void darwinPrintSymbol(SymbolicFi
H_64 = MachO->MachOObjectFile::getHeader64();
Filetype = H_64.filetype;
Flags = H_64.flags;
- STE_64 = MachO->getSymbol64TableEntry(SymDRI);
+ MachO::nlist_64 STE_64 = MachO->getSymbol64TableEntry(SymDRI);
NType = STE_64.n_type;
NSect = STE_64.n_sect;
NDesc = STE_64.n_desc;
@@ -290,7 +289,7 @@ static void darwinPrintSymbol(SymbolicFi
H = MachO->MachOObjectFile::getHeader();
Filetype = H.filetype;
Flags = H.flags;
- STE = MachO->getSymbolTableEntry(SymDRI);
+ MachO::nlist STE = MachO->getSymbolTableEntry(SymDRI);
NType = STE.n_type;
NSect = STE.n_sect;
NDesc = STE.n_desc;
More information about the llvm-commits
mailing list