summaryrefslogtreecommitdiffstats
path: root/runtime/native/dalvik_system_DexFile.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-01-16 15:53:38 +0000
committerVladimir Marko <vmarko@google.com>2014-01-16 19:44:03 +0000
commit60836d5a9bcf8b30984aae4279a4f6233b0bf622 (patch)
tree7779b989a6bdb12b0ddd2ae2506c8aea46c99d04 /runtime/native/dalvik_system_DexFile.cc
parent6e60cfd6d35ee7dbe68cee1ff2198d3b421ab686 (diff)
downloadart-60836d5a9bcf8b30984aae4279a4f6233b0bf622.tar.gz
art-60836d5a9bcf8b30984aae4279a4f6233b0bf622.tar.bz2
art-60836d5a9bcf8b30984aae4279a4f6233b0bf622.zip
Fix opening oat files that are out of date.
Make sure we're not using an old MAP_PRIVATE mapping of an OatFile after a forked process modifies the underlying file. Change-Id: I5c6caaf34272c805e40e95ee690dd948d7406751
Diffstat (limited to 'runtime/native/dalvik_system_DexFile.cc')
-rw-r--r--runtime/native/dalvik_system_DexFile.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index 600045f66a..45a2eed126 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -120,7 +120,9 @@ static jint DexFile_openDexFileNative(JNIEnv* env, jclass, jstring javaSourceNam
outputName.c_str(), &error_msg);
}
if (dex_file == nullptr) {
- CHECK_EQ(env->ExceptionCheck(), JNI_TRUE);
+ ScopedObjectAccess soa(env);
+ CHECK(!error_msg.empty());
+ ThrowIOException("%s", error_msg.c_str());
return 0;
}
return static_cast<jint>(reinterpret_cast<uintptr_t>(dex_file));