summaryrefslogtreecommitdiffstats
path: root/runtime/java_vm_ext.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-11-11 16:10:33 -0800
committerIan Rogers <irogers@google.com>2014-11-11 16:10:33 -0800
commitf4d4da18aa1914d10264082bd0433f59bff45453 (patch)
tree16edc1787c285135a0012cfc8737a8b89987f24b /runtime/java_vm_ext.cc
parent4c9c251c2a32cd8d1be21bc47a9188358cb9f17f (diff)
downloadart-f4d4da18aa1914d10264082bd0433f59bff45453.zip
art-f4d4da18aa1914d10264082bd0433f59bff45453.tar.gz
art-f4d4da18aa1914d10264082bd0433f59bff45453.tar.bz2
Allow JNI AttachCurrentThread to fail if not enough stack.
Add unit tests and move JavaVM JNI tests into there own set of gtests. Bug: 18330119 Change-Id: I0e93dff783b1f5d787b3084d24122883e14951a1
Diffstat (limited to 'runtime/java_vm_ext.cc')
-rw-r--r--runtime/java_vm_ext.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index 19e03d8..a5abce6 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -795,13 +795,13 @@ extern "C" jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args) {
return JNI_OK;
}
-extern "C" jint JNI_GetCreatedJavaVMs(JavaVM** vms, jsize, jsize* vm_count) {
+extern "C" jint JNI_GetCreatedJavaVMs(JavaVM** vms_buf, jsize buf_len, jsize* vm_count) {
Runtime* runtime = Runtime::Current();
- if (runtime == nullptr) {
+ if (runtime == nullptr || buf_len == 0) {
*vm_count = 0;
} else {
*vm_count = 1;
- vms[0] = runtime->GetJavaVM();
+ vms_buf[0] = runtime->GetJavaVM();
}
return JNI_OK;
}