From 310b0f5f15ac9ef8fb7ed0a12ff9ba3e4da17033 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 24 Jun 2015 12:41:20 +0100 Subject: Fix another case of un-verified dead code. bug:22042796 https://code.google.com/p/android/issues/detail?id=178008 (cherry picked from commit 1efcc22cd1895c48adccbe49270d8e8583c2b12d) Change-Id: I5c0d783e842da39cd3dcbb2f18ccf784e797a64f --- compiler/optimizing/builder.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index ed3992310c..b564aca27a 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -2062,8 +2062,13 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, uint32 case Instruction::MOVE_RESULT: case Instruction::MOVE_RESULT_WIDE: case Instruction::MOVE_RESULT_OBJECT: - UpdateLocal(instruction.VRegA(), latest_result_); - latest_result_ = nullptr; + if (latest_result_ == nullptr) { + // Only dead code can lead to this situation, where the verifier + // does not reject the method. + } else { + UpdateLocal(instruction.VRegA(), latest_result_); + latest_result_ = nullptr; + } break; case Instruction::CMP_LONG: { -- cgit v1.2.3-59-g8ed1b