[llvm] r248239 - [llvm-readobj/MachO] Ensure we always have valid CmdName/SegmentName.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 19:14:43 PDT 2015


Author: davide
Date: Mon Sep 21 21:14:43 2015
New Revision: 248239

URL: http://llvm.org/viewvc/llvm-project?rev=248239&view=rev
Log:
[llvm-readobj/MachO] Ensure we always have valid CmdName/SegmentName.

Otherwise we might end up printing garbage while dumping.

Differential Revision:	 http://reviews.llvm.org/D13041

Modified:
    llvm/trunk/tools/llvm-readobj/MachODumper.cpp

Modified: llvm/trunk/tools/llvm-readobj/MachODumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/MachODumper.cpp?rev=248239&r1=248238&r2=248239&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/MachODumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/MachODumper.cpp Mon Sep 21 21:14:43 2015
@@ -267,8 +267,8 @@ namespace {
   };
 
   struct MachOSegment {
-    StringRef CmdName;
-    StringRef SegName;
+    std::string CmdName;
+    std::string SegName;
     uint64_t cmdsize;
     uint64_t vmaddr;
     uint64_t vmsize;




More information about the llvm-commits mailing list