Execute an application even when dex2oat crashes.
Bug: 17000769
Change-Id: Iffeb582862a5e794b6c7364c7ec2368cfd0f2214
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index c3304e6..f199c99 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -114,7 +114,9 @@
bool success = linker->OpenDexFilesFromOat(sourceName.c_str(), outputName.c_str(), &error_msgs,
dex_files.get());
- if (success) {
+ if (success || !dex_files->empty()) {
+ // In the case of non-success, we have not found or could not generate the oat file.
+ // But we may still have found a dex file that we can use.
return static_cast<jlong>(reinterpret_cast<uintptr_t>(dex_files.release()));
} else {
// The vector should be empty after a failed loading attempt.