Fix handling of unresolved references in verifier.
The verifier should not treat use of unresolved references as a reason to reject
the entire class. Instead, the verifier treats the instruction as a throw. If
that class is run, the interpreter with extra checks will throw an exception.
Bug: 10457426
Change-Id: I3799da843a7ffb3519bbf6dc13a6276519d9cb95
diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h
index 63396d2..5ed3db3 100644
--- a/runtime/mirror/object-inl.h
+++ b/runtime/mirror/object-inl.h
@@ -71,6 +71,12 @@
Monitor::Wait(self, this, ms, ns, true, kTimedWaiting);
}
+inline bool Object::VerifierInstanceOf(const Class* klass) const {
+ DCHECK(klass != NULL);
+ DCHECK(GetClass() != NULL);
+ return klass->IsInterface() || InstanceOf(klass);
+}
+
inline bool Object::InstanceOf(const Class* klass) const {
DCHECK(klass != NULL);
DCHECK(GetClass() != NULL);