diff options
author | 2022-07-07 18:01:39 +0000 | |
---|---|---|
committer | 2022-07-07 18:01:39 +0000 | |
commit | 385e5df0ca2a739a4bdbe2ab364ce71adfa00bff (patch) | |
tree | 69d6acba23cf45cccc6e959d30719858a7df1de7 /runtime/common_throws.cc | |
parent | 50789e0685ceeb50e5adfe1d69ba1bd3f7a39c85 (diff) | |
parent | ffbdfeec4c9e851872513cfcc6508f7a39d19ad5 (diff) |
Fix one edge case at method linking to throw at runtime. am: d88c1499ef am: 8bc8a6b5b6 am: 3c3a870149 am: ffbdfeec4c
Original change: https://android-review.googlesource.com/c/platform/art/+/2146626
Change-Id: Ic51a13650e185755797854c4b75dbbbcde7058d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'runtime/common_throws.cc')
-rw-r--r-- | runtime/common_throws.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc index 3a33f2a3aa..0bc913874b 100644 --- a/runtime/common_throws.cc +++ b/runtime/common_throws.cc @@ -237,6 +237,19 @@ void ThrowIllegalAccessError(ObjPtr<mirror::Class> referrer, const char* fmt, .. va_end(args); } +void ThrowIllegalAccessErrorForImplementingMethod(ObjPtr<mirror::Class> klass, + ArtMethod* implementation_method, + ArtMethod* interface_method) + REQUIRES_SHARED(Locks::mutator_lock_) { + DCHECK(!implementation_method->IsAbstract()); + DCHECK(!implementation_method->IsPublic()); + ThrowIllegalAccessError( + klass, + "Method '%s' implementing interface method '%s' is not public", + implementation_method->PrettyMethod().c_str(), + interface_method->PrettyMethod().c_str()); +} + // IllegalAccessException void ThrowIllegalAccessException(const char* msg) { |