Fix another case of un-verified dead code.
bug:22042796
https://code.google.com/p/android/issues/detail?id=178008
Change-Id: Ie77ccf17ce2a69c86b2278f7920aa4ad39bf142b
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index c497526..2bb6fbe 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -2109,8 +2109,13 @@
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: {