ART: Do not check interface being subclass for member access
When checking access to a protected member, do not try to see
whether an interface is a subclass of the declaring class.
Bug: 16904661
(cherry picked from commit 81db6a7c20aa008c7edbb7377b4bc3a9afe91bb7)
Change-Id: I3e1fa4ce9753e0a96633fff0fba807d72bc0b19d
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index 519685a..2a3f104 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -555,7 +555,7 @@
}
// Check for protected access from a sub-class, which may or may not be in the same package.
if (member_flags & kAccProtected) {
- if (this->IsSubClass(access_to)) {
+ if (!this->IsInterface() && this->IsSubClass(access_to)) {
return true;
}
}