From f5f64efda943000168d34bfe44ccbbadd284e55f Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 15 Dec 2015 14:11:59 +0000 Subject: Detect phi cycles. Having reference and non-reference phi equivalent, only happened for the 0/null constant. To avoid such occurences, we must detect phi cycles. bug:25493693 Change-Id: Ie1a8460c3abacca96c299da107fa4407e17dd792 --- compiler/optimizing/graph_checker.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/optimizing/graph_checker.cc') diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index f3c1dbe3f5..3b93b2b571 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -763,6 +763,14 @@ void SSAChecker::VisitPhi(HPhi* phi) { phi->GetId(), phi->GetRegNumber(), type_str.str().c_str())); + } else if (phi->GetType() == Primitive::kPrimNot) { + std::stringstream type_str; + type_str << other_phi->GetType(); + AddError(StringPrintf( + "Equivalent non-reference phi (%d) found for VReg %d with type: %s.", + phi->GetId(), + phi->GetRegNumber(), + type_str.str().c_str())); } else { ArenaBitVector visited(GetGraph()->GetArena(), 0, /* expandable */ true); if (!IsConstantEquivalent(phi, other_phi, &visited)) { -- cgit v1.2.3-59-g8ed1b