[llvm-readobj/MachO] Ensure we always have valid CmdName/SegmentName.
authorDavide Italiano <davide@freebsd.org>
Tue, 22 Sep 2015 02:14:43 +0000 (02:14 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 22 Sep 2015 02:14:43 +0000 (02:14 +0000)
Otherwise we might end up printing garbage while dumping.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248239 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-readobj/MachODumper.cpp

index 177f79f..ab77fdc 100644 (file)
@@ -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;