From 0d9f17de8f21a10702de1510b73e89d07b3b9bbf Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 15 Apr 2015 14:17:44 +0100 Subject: Move the linear order to the HGraph. Bug found by Zheng Xu: SsaLivenessAnalysis being a stack allocated object, we should not refer to it in later phases of the compiler. Specifically, the code generator was using the linear order, which was stored in the liveness analysis object. Change-Id: I574641f522b7b86fc43f3914166108efc72edb3b --- compiler/optimizing/linearize_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/linearize_test.cc') diff --git a/compiler/optimizing/linearize_test.cc b/compiler/optimizing/linearize_test.cc index 28c5555d57..7818c606db 100644 --- a/compiler/optimizing/linearize_test.cc +++ b/compiler/optimizing/linearize_test.cc @@ -50,12 +50,12 @@ static void TestCode(const uint16_t* data, const int* expected_order, size_t num std::unique_ptr features_x86( X86InstructionSetFeatures::FromCppDefines()); x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions()); - SsaLivenessAnalysis liveness(*graph, &codegen); + SsaLivenessAnalysis liveness(graph, &codegen); liveness.Analyze(); - ASSERT_EQ(liveness.GetLinearOrder().Size(), number_of_blocks); + ASSERT_EQ(graph->GetLinearOrder().Size(), number_of_blocks); for (size_t i = 0; i < number_of_blocks; ++i) { - ASSERT_EQ(liveness.GetLinearOrder().Get(i)->GetBlockId(), expected_order[i]); + ASSERT_EQ(graph->GetLinearOrder().Get(i)->GetBlockId(), expected_order[i]); } } -- cgit v1.2.3-59-g8ed1b