summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-12-03 08:32:55 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-12-03 08:32:55 +0000
commitc90dfb6d83f6b51da9d5f2e7816d5d2de1ce3ecc (patch)
treeae55d22c73af57ff516bec440ce9a28a3320b7eb /runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
parent2ff6bd7ad049e2003342aaf60898fdfc68130908 (diff)
parentf630f1f7781529cc2dd1151faf7523a53d45d6e2 (diff)
Snap for 4481641 from f630f1f7781529cc2dd1151faf7523a53d45d6e2 to pi-release
Change-Id: Ib4edfa41e843d78fecf3371fb671479342411aa5
Diffstat (limited to 'runtime/entrypoints/quick/quick_dexcache_entrypoints.cc')
-rw-r--r--runtime/entrypoints/quick/quick_dexcache_entrypoints.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc b/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
index f7563129836..238ada94ff8 100644
--- a/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_dexcache_entrypoints.cc
@@ -41,6 +41,12 @@ static void StoreObjectInBss(ArtMethod* outer_method,
static_assert(sizeof(GcRoot<mirror::String>) == sizeof(GcRoot<mirror::Object>), "Size check.");
DCHECK_NE(bss_offset, IndexBssMappingLookup::npos);
DCHECK_ALIGNED(bss_offset, sizeof(GcRoot<mirror::Object>));
+ if (UNLIKELY(!oat_file->IsExecutable())) {
+ // There are situations where we execute bytecode tied to an oat file opened
+ // as non-executable (i.e. the AOT-compiled code cannot be executed) and we
+ // can JIT that bytecode and get here without the .bss being mmapped.
+ return;
+ }
GcRoot<mirror::Object>* slot = reinterpret_cast<GcRoot<mirror::Object>*>(
const_cast<uint8_t*>(oat_file->BssBegin() + bss_offset));
DCHECK_GE(slot, oat_file->GetBssGcRoots().data());