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
Change-Id: I32be914819946233babaa4cb7343844d97b61ba5
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index d7ddd67..2550694 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -255,7 +255,7 @@
bool HasVirtualOrInterfaceInvokes() const;
bool HasFailures() const;
bool HasInstructionThatWillThrow() const {
- return have_pending_runtime_throw_failure_;
+ return have_any_pending_runtime_throw_failure_;
}
const RegType& ResolveCheckedClass(uint32_t class_idx)
@@ -730,8 +730,12 @@
// would fail at runtime throwing an exception. Such an instruction causes the following code
// to be unreachable. This is set by Fail and used to ensure we don't process unreachable
// instructions that would hard fail the verification.
+ // Note: this flag is reset after processing each instruction.
bool have_pending_runtime_throw_failure_;
+ // A version of the above that is not reset and thus captures if there were *any* throw failures.
+ bool have_any_pending_runtime_throw_failure_;
+
// Info message log use primarily for verifier diagnostics.
std::ostringstream info_messages_;