Dump dex file sizes in oatdump.
Change-Id: I15d1ecfb9900a07b36209015e8b47718fdee19a7
diff --git a/src/oat_file.cc b/src/oat_file.cc
index 1e9d820..4e05325 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -234,9 +234,12 @@
OatFile::OatDexFile::~OatDexFile() {}
+size_t OatFile::OatDexFile::FileSize() const {
+ return reinterpret_cast<const DexFile::Header*>(dex_file_pointer_)->file_size_;
+}
+
const DexFile* OatFile::OatDexFile::OpenDexFile() const {
- size_t length = reinterpret_cast<const DexFile::Header*>(dex_file_pointer_)->file_size_;
- return DexFile::Open(dex_file_pointer_, length, dex_file_location_,
+ return DexFile::Open(dex_file_pointer_, FileSize(), dex_file_location_,
dex_file_location_checksum_);
}