[Lldb-commits] [PATCH] D42336: Fix memory leaks in TestArm64InstEmulation
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sat Jan 20 13:19:15 PST 2018
teemperor created this revision.
teemperor added a reviewer: jasonmolenda.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.
We never delete the created instances, so those test fail with the memory sanitizer.
https://reviews.llvm.org/D42336
Files:
unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
Index: unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
===================================================================
--- unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
+++ 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.130777.patch
Type: text/x-patch
Size: 2577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180120/619575f3/attachment.bin>
More information about the lldb-commits
mailing list