summaryrefslogtreecommitdiff
path: root/runtime/vdex_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/vdex_file.h')
-rw-r--r--runtime/vdex_file.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/vdex_file.h b/runtime/vdex_file.h
index 3ccbfa5567..fe65c07bac 100644
--- a/runtime/vdex_file.h
+++ b/runtime/vdex_file.h
@@ -246,8 +246,8 @@ class VdexFile {
const uint8_t* Begin() const { return mmap_.Begin(); }
const uint8_t* End() const { return mmap_.End(); }
size_t Size() const { return mmap_.Size(); }
- bool Contains(const uint8_t* pointer) const {
- return pointer >= Begin() && pointer < End();
+ bool Contains(const uint8_t* pointer, size_t size) const {
+ return Begin() <= pointer && size <= Size() && pointer <= End() - size;
}
const VdexFileHeader& GetVdexFileHeader() const {
@@ -296,6 +296,10 @@ class VdexFile {
// order must match too.
bool MatchesDexFileChecksums(const std::vector<const DexFile::Header*>& dex_headers) const;
+ // Returns true if all dex files are standard dex rather than compact dex.
+ // Also returns true if there are no dex files at all.
+ bool HasOnlyStandardDexFiles() const;
+
ClassStatus ComputeClassStatus(Thread* self, Handle<mirror::Class> cls) const
REQUIRES_SHARED(Locks::mutator_lock_);