summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2014-08-06 22:58:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-08-06 17:20:04 +0000
commit269c3360f8e69e9faf8bc8a51fd87ae7adadfb59 (patch)
treee6b96c5a139999feb13176f6a12f034cba6dd9f5 /compiler/driver/compiler_driver.cc
parent2524ffd731a3d173c9b0ad8f7b3e4a89d692aab6 (diff)
parent58a5af8568d224ca7eccf2483396ff9862f8d1ee (diff)
Merge "ART: Add guards to the dex cache and its shortcuts"
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index f40120e6a2..1233a0d401 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -805,11 +805,15 @@ void CompilerDriver::UpdateImageClasses(TimingLogger* timings) {
bool CompilerDriver::CanAssumeTypeIsPresentInDexCache(const DexFile& dex_file, uint32_t type_idx) {
if (IsImage() &&
IsImageClass(dex_file.StringDataByIdx(dex_file.GetTypeId(type_idx).descriptor_idx_))) {
- if (kIsDebugBuild) {
+ {
ScopedObjectAccess soa(Thread::Current());
mirror::DexCache* dex_cache = Runtime::Current()->GetClassLinker()->FindDexCache(dex_file);
mirror::Class* resolved_class = dex_cache->GetResolvedType(type_idx);
- CHECK(resolved_class != NULL);
+ if (resolved_class == nullptr) {
+ // Erroneous class.
+ stats_->TypeNotInDexCache();
+ return false;
+ }
}
stats_->TypeInDexCache();
return true;