summaryrefslogtreecommitdiff
path: root/runtime/dex_file_verifier.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-03-30 00:56:54 +0000
committer android-build-merger <android-build-merger@google.com> 2016-03-30 00:56:54 +0000
commit94eae2002dd31d1b4a828120dc724cdcb3fe68a0 (patch)
treeacfc8f526561079c8389572af97c96fda7475450 /runtime/dex_file_verifier.cc
parente54865fd15676d5241c2f17c8b67518d808ac731 (diff)
parenta923025e08e61fd2ff26e3d60c26e9db29637736 (diff)
Merge "ART: Postpone interface-related dex failure to version 37"
am: a923025 * commit 'a923025e08e61fd2ff26e3d60c26e9db29637736': ART: Postpone interface-related dex failure to version 37 Change-Id: Ifa0aa5b79843957efd2c17a298bb052ac1c13800
Diffstat (limited to 'runtime/dex_file_verifier.cc')
-rw-r--r--runtime/dex_file_verifier.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/runtime/dex_file_verifier.cc b/runtime/dex_file_verifier.cc
index 9c9b8c5517..811e76300a 100644
--- a/runtime/dex_file_verifier.cc
+++ b/runtime/dex_file_verifier.cc
@@ -2465,7 +2465,13 @@ bool DexFileVerifier::CheckFieldAccessFlags(uint32_t idx,
GetFieldDescriptionOrError(begin_, header_, idx).c_str(),
field_access_flags,
PrettyJavaAccessFlags(field_access_flags).c_str());
- return false;
+ if (header_->GetVersion() >= 37) {
+ return false;
+ } else {
+ // Allow in older versions, but warn.
+ LOG(WARNING) << "This dex file is invalid and will be rejected in the future. Error is: "
+ << *error_msg;
+ }
}
// Interface fields may be synthetic, but may not have other flags.
constexpr uint32_t kDisallowed = ~(kPublicFinalStatic | kAccSynthetic);
@@ -2474,7 +2480,13 @@ bool DexFileVerifier::CheckFieldAccessFlags(uint32_t idx,
GetFieldDescriptionOrError(begin_, header_, idx).c_str(),
field_access_flags,
PrettyJavaAccessFlags(field_access_flags).c_str());
- return false;
+ if (header_->GetVersion() >= 37) {
+ return false;
+ } else {
+ // Allow in older versions, but warn.
+ LOG(WARNING) << "This dex file is invalid and will be rejected in the future. Error is: "
+ << *error_msg;
+ }
}
return true;
}
@@ -2657,7 +2669,13 @@ bool DexFileVerifier::CheckMethodAccessFlags(uint32_t method_index,
*error_msg = StringPrintf("Interface method %" PRIu32 "(%s) is not public and abstract",
method_index,
GetMethodDescriptionOrError(begin_, header_, method_index).c_str());
- return false;
+ if (header_->GetVersion() >= 37) {
+ return false;
+ } else {
+ // Allow in older versions, but warn.
+ LOG(WARNING) << "This dex file is invalid and will be rejected in the future. Error is: "
+ << *error_msg;
+ }
}
// At this point, we know the method is public and abstract. This means that all the checks
// for invalid combinations above applies. In addition, interface methods must not be