[Lldb-commits] [PATCH] D42336: Fix memory leaks in TestArm64InstEmulation

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Jan 21 23:23:46 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL323076: Fix memory leaks in TestArm64InstEmulation (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D42336?vs=130777&id=130835#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42336

Files:
  lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp


Index: lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
===================================================================
--- lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
+++ lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
@@ -56,9 +56,9 @@
 
 TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -152,9 +152,9 @@
 
 TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -314,9 +314,9 @@
 
 TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -409,9 +409,9 @@
 
 TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -511,9 +511,9 @@
 
 TEST_F(TestArm64InstEmulation, TestRegisterDoubleSpills) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42336.130835.patch
Type: text/x-patch
Size: 2610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180122/b0635a3a/attachment-0001.bin>


More information about the lldb-commits mailing list