summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2016-03-31 10:03:07 -0700
committerAlex Light <allight@google.com>2016-04-05 11:35:23 -0700
commit565bc96291623bf617aef40739247b224188fd16 (patch)
tree16faf8504afa09b6f89bd9f9f6440d6ce4160bd0 /runtime/class_linker.cc
parent50e6f7ca6b071861d29a79736eb9e7a496b42c5b (diff)
downloadandroid_art-565bc96291623bf617aef40739247b224188fd16.tar.gz
android_art-565bc96291623bf617aef40739247b224188fd16.tar.bz2
android_art-565bc96291623bf617aef40739247b224188fd16.zip
Fix issued with non-public interface methods.
Some APK's ship with dex files containing non-public interface methods. These would cause crashes on newer versions of ART due to stricter verification of dex files. Make ART emit a warning but allow this behavior. Bug: 27928832 (cherry picked from commit d7c10c237bf2631630fac7982c3f374b1a27ed01) Change-Id: Ia3689ee091aa154fb5954b1f6dd50c489128acce
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 9d26d1305c..5ea5f8e188 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -5874,9 +5874,14 @@ ClassLinker::DefaultMethodSearchResult ClassLinker::FindDefaultMethodImplementat
!target_name_comparator.HasSameNameAndSignature(
current_method->GetInterfaceMethodIfProxy(image_pointer_size_))) {
continue;
+ } else if (!current_method->IsPublic()) {
+ // The verifier should have caught the non-public method for dex version 37. Just warn and
+ // skip it since this is from before default-methods so we don't really need to care that it
+ // has code.
+ LOG(WARNING) << "Interface method " << PrettyMethod(current_method) << " is not public! "
+ << "This will be a fatal error in subsequent versions of android. "
+ << "Continuing anyway.";
}
- // The verifier should have caught the non-public method.
- DCHECK(current_method->IsPublic()) << "Interface method is not public!";
if (UNLIKELY(chosen_iface.Get() != nullptr)) {
// We have multiple default impls of the same method. This is a potential default conflict.
// We need to check if this possibly conflicting method is either a superclass of the chosen