Don't abort if the oat file doesn't have dex2oat command line key. am: ab2fde3266 am: ac2db2a787 am: 8c0ffc394e
Original change: https://android-review.googlesource.com/c/platform/art/+/1611680
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I21c4538bdd757fedcf08d985dfdf99218847ed55
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index ac3cbdd..ecbe546 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -126,7 +126,10 @@
CHECK(oat_file != nullptr);
const char* cmd_line = oat_file->GetOatHeader().GetStoreValueByKey(OatHeader::kDex2OatCmdLineKey);
- CHECK(cmd_line != nullptr); // Huh? This should not happen.
+ if (cmd_line == nullptr) {
+ // Vdex-only execution, conservatively say no.
+ return JNI_FALSE;
+ }
// Check the backend.
constexpr const char* kCompilerBackend = "--compiler-backend=";