From 5c0048565e78ff53fd2b3a2e446c72ea2fffe239 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Mon, 23 Nov 2015 09:44:52 +0000 Subject: ART: Fix uninitialized variable Change-Id: I906de334b3c3cb1e36eff4944457f4598b7c174f --- compiler/optimizing/nodes.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 1680c07776..890598d687 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -2099,7 +2099,7 @@ HInstruction* HGraph::InsertOppositeCondition(HInstruction* cond, HInstruction* // Can't reverse floating point conditions. We have to use HBooleanNot in that case. HInstruction* lhs = cond->InputAt(0); HInstruction* rhs = cond->InputAt(1); - HInstruction* replacement; + HInstruction* replacement = nullptr; switch (cond->AsCondition()->GetOppositeCondition()) { // get *opposite* case kCondEQ: replacement = new (allocator) HEqual(lhs, rhs); break; case kCondNE: replacement = new (allocator) HNotEqual(lhs, rhs); break; @@ -2111,6 +2111,9 @@ HInstruction* HGraph::InsertOppositeCondition(HInstruction* cond, HInstruction* case kCondBE: replacement = new (allocator) HBelowOrEqual(lhs, rhs); break; case kCondA: replacement = new (allocator) HAbove(lhs, rhs); break; case kCondAE: replacement = new (allocator) HAboveOrEqual(lhs, rhs); break; + default: + LOG(FATAL) << "Unexpected condition"; + UNREACHABLE(); } cursor->GetBlock()->InsertInstructionBefore(replacement, cursor); return replacement; -- cgit v1.2.3-59-g8ed1b