From f4d4da18aa1914d10264082bd0433f59bff45453 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Tue, 11 Nov 2014 16:10:33 -0800 Subject: 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 --- runtime/java_vm_ext.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/java_vm_ext.cc') 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; } -- cgit v1.1