summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-02-03 21:06:44 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-02-03 21:06:44 +0000
commitbf23fb3a98bee71c54d00579d024e747dd78ed9e (patch)
tree16d73daee2c21a7e2c7c7d3edcd402d8be255717 /compiler
parentb78a8af993e877d74c5938f65f95feaf2fa01321 (diff)
parentde197549ba9c89c477140f415205e00d2c6075e3 (diff)
Merge "Add nullptr check for dex layout when opening the dex file fails."
Diffstat (limited to 'compiler')
-rw-r--r--compiler/oat_writer.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc
index bd2c5e3bfc..a16a34b299 100644
--- a/compiler/oat_writer.cc
+++ b/compiler/oat_writer.cc
@@ -2266,6 +2266,10 @@ bool OatWriter::LayoutAndWriteDexFile(OutputStream* out, OatDexFile* oat_dex_fil
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;
+ return false;
+ }
Options options;
options.output_to_memmap_ = true;
DexLayout dex_layout(options, profile_compilation_info_, nullptr);