llvm-objdump: Fix use after free.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 21 Sep 2011 04:01:19 +0000 (04:01 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 21 Sep 2011 04:01:19 +0000 (04:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140237 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/MachODump.cpp

index 7e3bb20d3e145ae17f9f7619a8f432bd46add8cd..0daf9d4214a7b30ea6de02a7202634efe25b58c4 100644 (file)
@@ -346,11 +346,11 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
   StringRef DebugAbbrevSection, DebugInfoSection, DebugArangesSection,
             DebugLineSection, DebugStrSection;
   OwningPtr<DIContext> diContext;
+  OwningPtr<MachOObject> DSYMObj;
   // Try to find debug info and set up the DIContext for it.
   if (UseDbg) {
     ArrayRef<Section> DebugSections = Sections;
     std::vector<Section> DSYMSections;
-    OwningPtr<MachOObject> DSYMObj;
 
     // A separate DSym file path was specified, parse it as a macho file,
     // get the sections and supply it to the section name parsing machinery.