diff options
author | Alexei Zavjalov <alexei.zavjalov@intel.com> | 2014-06-25 16:04:55 +0700 |
---|---|---|
committer | Alexei Zavjalov <alexei.zavjalov@intel.com> | 2014-07-02 13:16:59 +0700 |
commit | 3a1444ccb92fb1b11d4943c3baa1f0a3abed4f10 (patch) | |
tree | 0eba34d67a39959197877d5ce8924f935a1daaed /runtime/jni_internal_test.cc | |
parent | 29978887552542e3b7e7792070dad06392377648 (diff) | |
download | android_art-3a1444ccb92fb1b11d4943c3baa1f0a3abed4f10.tar.gz android_art-3a1444ccb92fb1b11d4943c3baa1f0a3abed4f10.tar.bz2 android_art-3a1444ccb92fb1b11d4943c3baa1f0a3abed4f10.zip |
ART: JNI ExceptionDescribe crashes if no exception occurred
Some tests are calling ExceptionDescribe without checking if
we have an exception occurred. The most JVM's like Dalvik can
handle this in a good way, but art crashes with JNI error.
This adds a check in art::ExceptionDescribe for a case when it
called without exception.
Change-Id: Id9eddcc73e78b1197109be5a6340f9ff60940c74
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
Diffstat (limited to 'runtime/jni_internal_test.cc')
-rw-r--r-- | runtime/jni_internal_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/jni_internal_test.cc b/runtime/jni_internal_test.cc index d255ec8dff..d50e094627 100644 --- a/runtime/jni_internal_test.cc +++ b/runtime/jni_internal_test.cc @@ -1472,6 +1472,12 @@ TEST_F(JniInternalTest, DeleteWeakGlobalRef) { env_->DeleteWeakGlobalRef(o2); } +TEST_F(JniInternalTest, ExceptionDescribe) { + // This checks how ExceptionDescribe handles call without exception. + env_->ExceptionClear(); + env_->ExceptionDescribe(); +} + TEST_F(JniInternalTest, Throw) { EXPECT_EQ(JNI_ERR, env_->Throw(nullptr)); |