summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2017-05-26 16:40:45 -0700
committer Calin Juravle <calin@google.com> 2017-06-01 22:53:47 +0000
commit1fff148498f68bbfbaa498c92fbc155fbfda4b80 (patch)
treeac2aea7000510adcf18f3637be70dc4fb64f3211 /compiler/optimizing
parent192289ec4e3848b6945a251954c5a3116fba0aec (diff)
Handle gracefully profiles with invalid classes or methods
Bug: 38410980 Test: m test-art-host-run-test-707 (cherry picked from commit 08556886a16ff2bb9fc3f184ac699de21c0369cd) Merged-In: Id28aa1eb333f0f4843722d091c6c7a877c0c78f6 Change-Id: I64f8e3baa7860571e3dc249ce218d4a0eb59d84d
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/inliner.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 2f09bc862a..79f5091041 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -664,6 +664,12 @@ HInliner::InlineCacheType HInliner::ExtractClassesFromOfflineProfile(
ObjPtr<mirror::DexCache> dex_cache =
dex_profile_index_to_dex_cache[class_ref.dex_profile_index];
DCHECK(dex_cache != nullptr);
+
+ if (!dex_cache->GetDexFile()->IsTypeIndexValid(class_ref.type_index)) {
+ VLOG(compiler) << "Profile data corrupt: type index " << class_ref.type_index
+ << "is invalid in location" << dex_cache->GetDexFile()->GetLocation();
+ return kInlineCacheNoData;
+ }
ObjPtr<mirror::Class> clazz = ClassLinker::LookupResolvedType(
class_ref.type_index,
dex_cache,