ART: Follow-up to 507cc6f83bf6379728f2dd20391f2ed5fbfe6371
Do not trigger DCHECK aborts for final and abstract classes when
they are used from other classes. Instead issue a soft error that
leads to a runtime failure.
Bug: 21873151
Change-Id: Ie5251a176722811b3c74585222874313a53f7e02
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index 824daf6..994616f 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -670,6 +670,14 @@
const RegType& DetermineCat1Constant(int32_t value, bool precise)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ // Try to create a register type from the given class. In case a precise type is requested, but
+ // the class is not instantiable, a soft error (of type NO_CLASS) will be enqueued and a
+ // non-precise reference will be returned.
+ // Note: we reuse NO_CLASS as this will throw an exception at runtime, when the failing class is
+ // actually touched.
+ const RegType& FromClass(const char* descriptor, mirror::Class* klass, bool precise)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
// The thread we're verifying on.
Thread* const self_;