diff options
Diffstat (limited to 'compiler/oat_writer.cc')
| -rw-r--r-- | compiler/oat_writer.cc | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index 43f606af65..afcdf5ea17 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -2270,28 +2270,11 @@ bool OatWriter::LayoutAndWriteDexFile(OutputStream* out, OatDexFile* oat_dex_fil /* verify */ true, /* verify_checksum */ true, &error_msg); - } else if (oat_dex_file->source_.IsRawFile()) { - File* raw_file = oat_dex_file->source_.GetRawFile(); - dex_file = DexFile::OpenDex(raw_file->Fd(), location, /* verify_checksum */ true, &error_msg); } else { - // The source data is a vdex file. - CHECK(oat_dex_file->source_.IsRawData()) + CHECK(oat_dex_file->source_.IsRawFile()) << static_cast<size_t>(oat_dex_file->source_.GetType()); - const uint8_t* raw_dex_file = oat_dex_file->source_.GetRawData(); - // Note: The raw data has already been checked to contain the header - // and all the data that the header specifies as the file size. - DCHECK(raw_dex_file != nullptr); - DCHECK(ValidateDexFileHeader(raw_dex_file, oat_dex_file->GetLocation())); - const UnalignedDexFileHeader* header = AsUnalignedDexFileHeader(raw_dex_file); - // Since the source may have had its layout changed, don't verify the checksum. - dex_file = DexFile::Open(raw_dex_file, - header->file_size_, - location, - oat_dex_file->dex_file_location_checksum_, - nullptr, - /* verify */ true, - /* verify_checksum */ false, - &error_msg); + File* raw_file = oat_dex_file->source_.GetRawFile(); + dex_file = DexFile::OpenDex(raw_file->Fd(), location, /* verify_checksum */ true, &error_msg); } if (dex_file == nullptr) { LOG(ERROR) << "Failed to open dex file for layout: " << error_msg; |