Allow soft failures at runtime and fix null referrer for ICCE and NSME.
Change-Id: I814369f4e41cebf37007cb514a8bf19cbaf17e94
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index 9c0e380..070c616 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -396,16 +396,14 @@
case VERIFY_ERROR_ACCESS_METHOD:
case VERIFY_ERROR_INSTANTIATION:
case VERIFY_ERROR_CLASS_CHANGE:
- if (Runtime::Current()->IsCompiler()) {
- // If we're optimistically running verification at compile time, turn NO_xxx, ACCESS_xxx,
- // class change and instantiation errors into soft verification errors so that we re-verify
- // at runtime. We may fail to find or to agree on access because of not yet available class
- // loaders, or class loaders that will differ at runtime. In these cases, we don't want to
- // affect the soundness of the code being compiled. Instead, the generated code runs "slow
- // paths" that dynamically perform the verification and cause the behavior to be that akin
- // to an interpreter.
- error = VERIFY_ERROR_BAD_CLASS_SOFT;
- }
+ // If we're optimistically running verification at compile time, turn NO_xxx, ACCESS_xxx,
+ // class change and instantiation errors into soft verification errors so that we re-verify
+ // at runtime. We may fail to find or to agree on access because of not yet available class
+ // loaders, or class loaders that will differ at runtime. In these cases, we don't want to
+ // affect the soundness of the code being compiled. Instead, the generated code runs "slow
+ // paths" that dynamically perform the verification and cause the behavior to be that akin
+ // to an interpreter.
+ error = VERIFY_ERROR_BAD_CLASS_SOFT;
break;
// Indication that verification should be retried at runtime.
case VERIFY_ERROR_BAD_CLASS_SOFT:
diff --git a/src/verifier/method_verifier.h b/src/verifier/method_verifier.h
index 273552d..3e3154b 100644
--- a/src/verifier/method_verifier.h
+++ b/src/verifier/method_verifier.h
@@ -659,6 +659,7 @@
friend struct art::ReferenceMap2Visitor; // for VerifyMethodAndDump
};
+std::ostream& operator<<(std::ostream& os, const MethodVerifier::FailureKind& rhs);
} // namespace verifier
} // namespace art