summaryrefslogtreecommitdiff
path: root/libartbase/base/mem_map.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libartbase/base/mem_map.cc')
-rw-r--r--libartbase/base/mem_map.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/libartbase/base/mem_map.cc b/libartbase/base/mem_map.cc
index 08d452b5ff..5c785618ba 100644
--- a/libartbase/base/mem_map.cc
+++ b/libartbase/base/mem_map.cc
@@ -531,10 +531,9 @@ MemMap MemMap::MapFileAtAddress(uint8_t* expected_ptr,
// Note that we do not allow MAP_FIXED unless reuse == true or we have an existing
// reservation, i.e we expect this mapping to be contained within an existing map.
- if (reuse) {
+ if (reuse && expected_ptr != nullptr) {
// reuse means it is okay that it overlaps an existing page mapping.
// Only use this if you actually made the page reservation yourself.
- CHECK(expected_ptr != nullptr);
DCHECK(reservation == nullptr);
DCHECK(error_msg != nullptr);
DCHECK(ContainedWithinExistingMap(expected_ptr, byte_count, error_msg))