From 3a2e78ebade9f7e0444be6f6817cbf116b34e7b1 Mon Sep 17 00:00:00 2001 From: Anton Kirilov Date: Fri, 6 Jan 2017 13:33:42 +0000 Subject: Fix some issues reported by Valgrind * Update the target suppression file. * Disable the detection of mismatched free() / delete / delete [] calls, since it results in a lot of false positives (a known Valgrind limitation associated with asymmetric inlining of operator new() and operator delete()). * Avoid a memory leak in the code generator tests, caused by the fact that the VIXL-based ARM code generator does not always use the arena allocator. * Fix an access to uninitialized memory. Test: m valgrind-test-art-target Test: valgrind --leak-check=full --show-mismatched-frees=no \ --ignore-range-below-sp=1024-1 \ --suppressions=valgrind-target-suppressions.txt \ dalvikvm ... Change-Id: I891a3247aa9828226b4e62c69d6e1c8398d757b8 --- compiler/optimizing/codegen_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/codegen_test.cc') diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index 879b4ce59e..e3f3df0ff5 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -15,6 +15,7 @@ */ #include +#include #include "arch/instruction_set.h" #include "arch/arm/instruction_set_features_arm.h" @@ -299,8 +300,8 @@ static void RunCode(CodegenTargetConfig target_config, bool has_result, Expected expected) { CompilerOptions compiler_options; - CodeGenerator* codegen = target_config.CreateCodeGenerator(graph, compiler_options); - RunCode(codegen, graph, hook_before_codegen, has_result, expected); + std::unique_ptr codegen(target_config.CreateCodeGenerator(graph, compiler_options)); + RunCode(codegen.get(), graph, hook_before_codegen, has_result, expected); } #ifdef ART_ENABLE_CODEGEN_arm -- cgit v1.2.3-59-g8ed1b