diff options
author | Andreas Gampe <agampe@google.com> | 2015-06-25 10:26:40 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-06-25 12:51:37 -0700 |
commit | 6415013f0b9509fed8367871daaf66c6841223f1 (patch) | |
tree | 238e59acda393f860d36f3bf80e80a01b59a347a /runtime/verifier/method_verifier.cc | |
parent | 005deb0a1683f9ee03a2cf2785dc6a7d7a8f16be (diff) | |
download | art-6415013f0b9509fed8367871daaf66c6841223f1.zip art-6415013f0b9509fed8367871daaf66c6841223f1.tar.gz art-6415013f0b9509fed8367871daaf66c6841223f1.tar.bz2 |
ART: Reset runtime_throw_failure flag
The flag is instruction-specific. It transports the info from Fail
to the main loop. It must be cleared after each iteration.
Introduce a second flag to store whether we saw such a failure at
all.
Update test expectations.
Bug: 22080519
(cherry picked from commit d12e782bcee03ecb6dec41aa9673ef53b638dcea)
Change-Id: I32be914819946233babaa4cb7343844d97b61ba5
Diffstat (limited to 'runtime/verifier/method_verifier.cc')
-rw-r--r-- | runtime/verifier/method_verifier.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 89f5115..1f7dd58 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -400,6 +400,7 @@ MethodVerifier::MethodVerifier(Thread* self, monitor_enter_dex_pcs_(nullptr), have_pending_hard_failure_(false), have_pending_runtime_throw_failure_(false), + have_any_pending_runtime_throw_failure_(false), new_instance_count_(0), monitor_enter_count_(0), can_load_classes_(can_load_classes), @@ -1636,6 +1637,7 @@ bool MethodVerifier::CodeFlowVerifyInstruction(uint32_t* start_guess) { } else if (kIsDebugBuild) { saved_line_->FillWithGarbage(); } + DCHECK(!have_pending_runtime_throw_failure_); // Per-instruction flag, should not be set here. // We need to ensure the work line is consistent while performing validation. When we spot a @@ -2936,6 +2938,10 @@ bool MethodVerifier::CodeFlowVerifyInstruction(uint32_t* start_guess) { } else if (have_pending_runtime_throw_failure_) { /* checking interpreter will throw, mark following code as unreachable */ opcode_flags = Instruction::kThrow; + have_any_pending_runtime_throw_failure_ = true; + // Reset the pending_runtime_throw flag. The flag is a global to decouple Fail and is per + // instruction. + have_pending_runtime_throw_failure_ = false; } /* * If we didn't just set the result register, clear it out. This ensures that you can only use |