ART: Relax verifier checks
Only bail for unresolved merge types in a couple of cases. Follow-up
to bb18a03c44d99b3cae232d445d56e80d8388cca9.
Bug: 27799205
Change-Id: If448e14036bc5e245677e0cd8cdddee02b320525
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 9bcbdbd..55d1720 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -4258,7 +4258,7 @@
}
} else if (!array_type.IsArrayTypes()) {
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "not array type " << array_type << " with aget";
- } else if (array_type.IsUnresolvedTypes()) {
+ } else if (array_type.IsUnresolvedMergedReference()) {
// Unresolved array types must be reference array types.
if (is_primitive) {
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "reference array type " << array_type
@@ -4266,6 +4266,10 @@
} else {
Fail(VERIFY_ERROR_NO_CLASS) << "cannot verify aget for " << array_type
<< " because of missing class";
+ // Approximate with java.lang.Object[].
+ work_line_->SetRegisterType<LockOp::kClear>(this,
+ inst->VRegA_23x(),
+ reg_types_.JavaLangObject(false));
}
} else {
/* verify the class */
@@ -4377,7 +4381,7 @@
work_line_->VerifyRegisterType(this, inst->VRegA_23x(), *modified_reg_type);
} else if (!array_type.IsArrayTypes()) {
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "not array type " << array_type << " with aput";
- } else if (array_type.IsUnresolvedTypes()) {
+ } else if (array_type.IsUnresolvedMergedReference()) {
// Unresolved array types must be reference array types.
if (is_primitive) {
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "put insn has type '" << insn_type