diff options
-rw-r--r-- | vm/analysis/DexPrepare.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp index 7c249ad86..174e5f353 100644 --- a/vm/analysis/DexPrepare.cpp +++ b/vm/analysis/DexPrepare.cpp @@ -90,13 +90,13 @@ static bool directoryIsValid(const std::string& fileName) return false; } - if (access(dirName.c_str(), R_OK) < 0) { - LOGE("Dex cache directory isn't readable: %s", dirName.c_str()); + if (access(dirName.c_str(), W_OK) < 0) { + LOGE("Dex cache directory isn't writable: %s", dirName.c_str()); return false; } - if (access(dirName.c_str(), W_OK) < 0) { - LOGE("Dex cache directory isn't writable: %s", dirName.c_str()); + if (access(dirName.c_str(), R_OK) < 0) { + LOGE("Dex cache directory isn't readable: %s", dirName.c_str()); return false; } @@ -881,6 +881,12 @@ bail: /* * On success, return the pieces that the caller asked for. */ + + if (pDvmDex != NULL) { + /* break link between the two */ + pDvmDex->pDexFile->pClassLookup = NULL; + } + if (ppDvmDex == NULL || !result) { dvmDexFileFree(pDvmDex); } else { @@ -893,9 +899,6 @@ bail: *ppClassLookup = pClassLookup; } - /* break link between the two */ - pDvmDex->pDexFile->pClassLookup = NULL; - return result; } |