[Lldb-commits] [PATCH] D42347: Fix memory leaks in	MinidumpParserTest
    Raphael Isemann via Phabricator via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Mon Jan 22 01:51:28 PST 2018
    
    
  
This revision was automatically updated to reflect the committed changes.
Closed by commit rL323085: Fix memory leaks in MinidumpParserTest (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
  https://reviews.llvm.org/D42347?vs=130846&id=130847#toc
Repository:
  rL LLVM
https://reviews.llvm.org/D42347
Files:
  lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
Index: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
===================================================================
--- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
+++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
@@ -315,9 +315,9 @@
   llvm::ArrayRef<uint8_t> registers(parser->GetThreadContext(thread));
 
   ArchSpec arch = parser->GetArchitecture();
-  RegisterInfoInterface *reg_interface = new RegisterContextLinux_i386(arch);
+  auto reg_interface = llvm::make_unique<RegisterContextLinux_i386>(arch);
   lldb::DataBufferSP buf =
-      ConvertMinidumpContext_x86_32(registers, reg_interface);
+      ConvertMinidumpContext_x86_32(registers, reg_interface.get());
   ASSERT_EQ(reg_interface->GetGPRSize(), buf->GetByteSize());
 
   const RegisterInfo *reg_info = reg_interface->GetRegisterInfo();
@@ -357,9 +357,9 @@
   llvm::ArrayRef<uint8_t> registers(parser->GetThreadContext(thread));
 
   ArchSpec arch = parser->GetArchitecture();
-  RegisterInfoInterface *reg_interface = new RegisterContextLinux_x86_64(arch);
+  auto reg_interface = llvm::make_unique<RegisterContextLinux_x86_64>(arch);
   lldb::DataBufferSP buf =
-      ConvertMinidumpContext_x86_64(registers, reg_interface);
+      ConvertMinidumpContext_x86_64(registers, reg_interface.get());
   ASSERT_EQ(reg_interface->GetGPRSize(), buf->GetByteSize());
 
   const RegisterInfo *reg_info = reg_interface->GetRegisterInfo();
@@ -407,9 +407,9 @@
   llvm::ArrayRef<uint8_t> registers(parser->GetThreadContextWow64(thread));
 
   ArchSpec arch = parser->GetArchitecture();
-  RegisterInfoInterface *reg_interface = new RegisterContextLinux_i386(arch);
+  auto reg_interface = llvm::make_unique<RegisterContextLinux_i386>(arch);
   lldb::DataBufferSP buf =
-      ConvertMinidumpContext_x86_32(registers, reg_interface);
+      ConvertMinidumpContext_x86_32(registers, reg_interface.get());
   ASSERT_EQ(reg_interface->GetGPRSize(), buf->GetByteSize());
 
   const RegisterInfo *reg_info = reg_interface->GetRegisterInfo();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42347.130847.patch
Type: text/x-patch
Size: 2045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180122/daedd9bd/attachment.bin>
    
    
More information about the lldb-commits
mailing list