diff options
author | Brian Carlstrom <bdc@google.com> | 2013-11-12 01:52:44 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2013-11-12 10:18:00 -0800 |
commit | 08377a7ff48c7a7eadcfbc998297567381a2c366 (patch) | |
tree | 6a01112a025df13934185442732d8944b79fc2e4 | |
parent | d492f91ffd9c725992c39c1a746f91e058563902 (diff) | |
download | art-08377a7ff48c7a7eadcfbc998297567381a2c366.zip art-08377a7ff48c7a7eadcfbc998297567381a2c366.tar.gz art-08377a7ff48c7a7eadcfbc998297567381a2c366.tar.bz2 |
Fix CTS failures caused by ignoring malformed dex files in dex2oat
Bug: 11621003
Bug: 11599365
(cherry-picked from commit d5aba599561d8d14bb8c19fd633bfcd05af3c264)
Change-Id: Ie204d634f6951f6856ed92e2191f07262b28bc05
-rw-r--r-- | dex2oat/dex2oat.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index c4cce2f..0be15fc 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -416,6 +416,11 @@ static size_t OpenDexFiles(const std::vector<const char*>& dex_filenames, for (size_t i = 0; i < dex_filenames.size(); i++) { const char* dex_filename = dex_filenames[i]; const char* dex_location = dex_locations[i]; + std::string error_msg; + if (!OS::FileExists(dex_filename)) { + LOG(WARNING) << "Skipping non-existent dex file '" << dex_filename << "'"; + continue; + } const DexFile* dex_file = DexFile::Open(dex_filename, dex_location); if (dex_file == NULL) { LOG(WARNING) << "Failed to open .dex from file '" << dex_filename << "'\n"; |