Fix memory leaks in TestArm64InstEmulation

Summary: We never delete the created instances, so those test fail with the memory sanitizer.

Reviewers: jasonmolenda

Reviewed By: jasonmolenda

Subscribers: aemerson, javed.absar, kristof.beyls, lldb-commits

Differential Revision: https://reviews.llvm.org/D42336

llvm-svn: 323076
This commit is contained in:
Raphael Isemann 2018-01-22 07:22:13 +00:00
parent fbdf0b9315
commit bb3c570633
1 changed files with 10 additions and 10 deletions

View File

@ -56,9 +56,9 @@ void TestArm64InstEmulation::TearDownTestCase() {
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, TestSimpleDarwinFunction) {
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, TestMediumDarwinFunction) {
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, TestFramelessThreeEpilogueFunction) {
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, TestRegisterSavedTwice) {
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;