summaryrefslogtreecommitdiffstats
path: root/compiler/jni
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-04-10 19:57:29 -0700
committerAndreas Gampe <agampe@google.com>2015-04-10 20:42:14 -0700
commit48ee356484225ef0d7cfa197b1699524b866c802 (patch)
treeea33754d124d5e15b02e1a7c09c81d27fd625ba3 /compiler/jni
parent58565098b2298041ccc97371a3cc486df88d51b3 (diff)
downloadandroid_art-48ee356484225ef0d7cfa197b1699524b866c802.tar.gz
android_art-48ee356484225ef0d7cfa197b1699524b866c802.tar.bz2
android_art-48ee356484225ef0d7cfa197b1699524b866c802.zip
ART: Ignore result for exception-case JNIEndWithReference
The value may not contain a valid jobject, so ignore and use null directly. Refactor a bit to have one common function for both synchronized and non-synchronized case. Add a test to the JNI compiler tests. Bug: 18135031 Change-Id: If2f004a112f36f4ff68172a946dec67ce561ae4d
Diffstat (limited to 'compiler/jni')
-rw-r--r--compiler/jni/jni_compiler_test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index 70bfb81c23..4186891a2a 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -164,6 +164,7 @@ class JniCompilerTest : public CommonCompilerTest {
void CheckParameterAlignImpl();
void MaxParamNumberImpl();
void WithoutImplementationImpl();
+ void WithoutImplementationRefReturnImpl();
void StackArgsIntsFirstImpl();
void StackArgsFloatsFirstImpl();
void StackArgsMixedImpl();
@@ -1494,6 +1495,20 @@ void JniCompilerTest::WithoutImplementationImpl() {
JNI_TEST(WithoutImplementation)
+void JniCompilerTest::WithoutImplementationRefReturnImpl() {
+ // This will lead to error messages in the log.
+ ScopedLogSeverity sls(LogSeverity::FATAL);
+
+ SetUpForTest(false, "withoutImplementationRefReturn", "()Ljava/lang/Object;", nullptr);
+
+ env_->CallObjectMethod(jobj_, jmethod_);
+
+ EXPECT_TRUE(Thread::Current()->IsExceptionPending());
+ EXPECT_TRUE(env_->ExceptionCheck() == JNI_TRUE);
+}
+
+JNI_TEST(WithoutImplementationRefReturn)
+
void Java_MyClassNatives_stackArgsIntsFirst(JNIEnv*, jclass, jint i1, jint i2, jint i3,
jint i4, jint i5, jint i6, jint i7, jint i8, jint i9,
jint i10, jfloat f1, jfloat f2, jfloat f3, jfloat f4,