From 60836d5a9bcf8b30984aae4279a4f6233b0bf622 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 16 Jan 2014 15:53:38 +0000 Subject: 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 --- runtime/native/dalvik_system_DexFile.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/native/dalvik_system_DexFile.cc') 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(reinterpret_cast(dex_file)); -- cgit v1.2.3