diff options
author | Andreas Gampe <agampe@google.com> | 2014-09-10 23:43:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-10 23:43:32 +0000 |
commit | b9620f305c79914f5159cf9279a7ccd173af1186 (patch) | |
tree | edfb15d759f16808d575cb849302fc2fd22d6709 /compiler | |
parent | 575a5649715ee50e0de8a107e8a5379d4c465382 (diff) | |
parent | 928f72bd75c385ba2708c58521171a77264d4486 (diff) | |
download | art-b9620f305c79914f5159cf9279a7ccd173af1186.zip art-b9620f305c79914f5159cf9279a7ccd173af1186.tar.gz art-b9620f305c79914f5159cf9279a7ccd173af1186.tar.bz2 |
Merge "ART: Fix things for valgrind"
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 2 | ||||
-rw-r--r-- | compiler/oat_test.cc | 14 | ||||
-rw-r--r-- | compiler/utils/assembler.cc | 1 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.h | 2 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64_test.cc | 7 |
5 files changed, 17 insertions, 9 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 32a7676..db6a01e 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -981,7 +981,7 @@ bool CompilerDriver::CanEmbedReferenceTypeInCode(ClassReference* ref, ScopedObjectAccess soa(Thread::Current()); mirror::Class* reference_class = mirror::Reference::GetJavaLangRefReference(); - bool is_initialized; + bool is_initialized = false; bool unused_finalizable; // Make sure we have a finished Reference class object before attempting to use it. if (!CanEmbedTypeInCode(*reference_class->GetDexCache()->GetDexFile(), diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index e858a7b..80d7b98 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -197,13 +197,13 @@ TEST_F(OatTest, OatHeaderIsValid) { std::vector<const DexFile*> dex_files; uint32_t image_file_location_oat_checksum = 0; uint32_t image_file_location_oat_begin = 0; - OatHeader* oat_header = OatHeader::Create(instruction_set, - instruction_set_features, - &dex_files, - image_file_location_oat_checksum, - image_file_location_oat_begin, - nullptr); - ASSERT_NE(oat_header, nullptr); + std::unique_ptr<OatHeader> oat_header(OatHeader::Create(instruction_set, + instruction_set_features, + &dex_files, + image_file_location_oat_checksum, + image_file_location_oat_begin, + nullptr)); + ASSERT_NE(oat_header.get(), nullptr); ASSERT_TRUE(oat_header->IsValid()); char* magic = const_cast<char*>(oat_header->GetMagic()); diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc index 68b784a..e3045e1 100644 --- a/compiler/utils/assembler.cc +++ b/compiler/utils/assembler.cc @@ -92,6 +92,7 @@ void AssemblerBuffer::ExtendCapacity() { // Compute the relocation delta and switch to the new contents area. ptrdiff_t delta = new_contents - contents_; + delete[] contents_; contents_ = new_contents; // Update the cursor and recompute the limit. diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h index 3f9f007..763dafe 100644 --- a/compiler/utils/x86_64/assembler_x86_64.h +++ b/compiler/utils/x86_64/assembler_x86_64.h @@ -253,7 +253,7 @@ class Address : public Operand { class X86_64Assembler FINAL : public Assembler { public: - X86_64Assembler() {} + X86_64Assembler() : cfi_cfa_offset_(0), cfi_pc_(0) {} virtual ~X86_64Assembler() {} /* diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index 4ed7b20..7a48b63 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -16,6 +16,7 @@ #include "assembler_x86_64.h" +#include "base/stl_util.h" #include "utils/assembler_test.h" namespace art { @@ -62,6 +63,11 @@ class AssemblerX86_64Test : public AssemblerTest<x86_64::X86_64Assembler, x86_64 } } + void TearDown() OVERRIDE { + AssemblerTest::TearDown(); + STLDeleteElements(®isters_); + } + std::vector<x86_64::CpuRegister*> GetRegisters() OVERRIDE { return registers_; } @@ -219,6 +225,7 @@ std::string setcc_test_fn(x86_64::X86_64Assembler* assembler) { } } + STLDeleteElements(®isters); return str.str(); } |