diff options
Diffstat (limited to 'compiler/oat_writer.cc')
| -rw-r--r-- | compiler/oat_writer.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index 34d2ec9cde..43f606af65 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -1225,7 +1225,7 @@ class OatWriter::WriteCodeMethodVisitor : public OatDexMethodVisitor { break; } default: { - DCHECK_EQ(patch.GetType(), LinkerPatch::Type::kRecordPosition); + DCHECK(false) << "Unexpected linker patch type: " << patch.GetType(); break; } } @@ -2260,6 +2260,10 @@ bool OatWriter::LayoutAndWriteDexFile(OutputStream* out, OatDexFile* oat_dex_fil ZipEntry* zip_entry = oat_dex_file->source_.GetZipEntry(); std::unique_ptr<MemMap> mem_map( zip_entry->ExtractToMemMap(location.c_str(), "classes.dex", &error_msg)); + if (mem_map == nullptr) { + LOG(ERROR) << "Failed to extract dex file to mem map for layout: " << error_msg; + return false; + } dex_file = DexFile::Open(location, zip_entry->GetCrc32(), std::move(mem_map), @@ -2283,7 +2287,7 @@ bool OatWriter::LayoutAndWriteDexFile(OutputStream* out, OatDexFile* oat_dex_fil dex_file = DexFile::Open(raw_dex_file, header->file_size_, location, - header->checksum_, + oat_dex_file->dex_file_location_checksum_, nullptr, /* verify */ true, /* verify_checksum */ false, |