summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/dex_file.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index 9cb2f1ba01..3ff55ab323 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -258,15 +258,15 @@ const DexFile* DexFile::Open(const ZipArchive& zip_archive, const std::string& l
error_msg->c_str());
return nullptr;
}
- if (!DexFileVerifier::Verify(dex_file.get(), dex_file->Begin(), dex_file->Size(),
- location.c_str(), error_msg)) {
- return nullptr;
- }
if (!dex_file->DisableWrite()) {
*error_msg = StringPrintf("Failed to make dex file '%s' read only", location.c_str());
return nullptr;
}
CHECK(dex_file->IsReadOnly()) << location;
+ if (!DexFileVerifier::Verify(dex_file.get(), dex_file->Begin(), dex_file->Size(),
+ location.c_str(), error_msg)) {
+ return nullptr;
+ }
return dex_file.release();
}