From 1efcc22cd1895c48adccbe49270d8e8583c2b12d 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 Change-Id: Ie77ccf17ce2a69c86b2278f7920aa4ad39bf142b --- compiler/optimizing/builder.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/builder.cc') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index c49752642b..2bb6fbe350 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -2109,8 +2109,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