提交 8ced885b 编写于 作者: M msheppar

8036609: Check jdk/src/windows/native/java/lang/ProcessImpl_md.c for JNI pending exceptions

Summary: added ExceptionCheck fater JNI calls
Reviewed-by: chegar
上级 62233791
...@@ -359,24 +359,28 @@ Java_java_lang_ProcessImpl_create(JNIEnv *env, jclass ignored, ...@@ -359,24 +359,28 @@ Java_java_lang_ProcessImpl_create(JNIEnv *env, jclass ignored,
const jchar *penvBlock = (envBlock != NULL) const jchar *penvBlock = (envBlock != NULL)
? (*env)->GetStringChars(env, envBlock, NULL) ? (*env)->GetStringChars(env, envBlock, NULL)
: NULL; : NULL;
const jchar *pdir = (dir != NULL) if (!(*env)->ExceptionCheck(env)) {
? (*env)->GetStringChars(env, dir, NULL) const jchar *pdir = (dir != NULL)
: NULL; ? (*env)->GetStringChars(env, dir, NULL)
jlong *handles = (*env)->GetLongArrayElements(env, stdHandles, NULL); : NULL;
if (handles != NULL) { if (!(*env)->ExceptionCheck(env)) {
ret = processCreate( jlong *handles = (*env)->GetLongArrayElements(env, stdHandles, NULL);
env, if (handles != NULL) {
pcmd, ret = processCreate(
penvBlock, env,
pdir, pcmd,
handles, penvBlock,
redirectErrorStream); pdir,
(*env)->ReleaseLongArrayElements(env, stdHandles, handles, 0); handles,
redirectErrorStream);
(*env)->ReleaseLongArrayElements(env, stdHandles, handles, 0);
}
if (pdir != NULL)
(*env)->ReleaseStringChars(env, dir, pdir);
}
if (penvBlock != NULL)
(*env)->ReleaseStringChars(env, envBlock, penvBlock);
} }
if (pdir != NULL)
(*env)->ReleaseStringChars(env, dir, pdir);
if (penvBlock != NULL)
(*env)->ReleaseStringChars(env, envBlock, penvBlock);
(*env)->ReleaseStringChars(env, cmd, pcmd); (*env)->ReleaseStringChars(env, cmd, pcmd);
} }
} }
...@@ -448,7 +452,7 @@ Java_java_lang_ProcessImpl_isProcessAlive(JNIEnv *env, jclass ignored, jlong han ...@@ -448,7 +452,7 @@ Java_java_lang_ProcessImpl_isProcessAlive(JNIEnv *env, jclass ignored, jlong han
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_java_lang_ProcessImpl_closeHandle(JNIEnv *env, jclass ignored, jlong handle) Java_java_lang_ProcessImpl_closeHandle(JNIEnv *env, jclass ignored, jlong handle)
{ {
return CloseHandle((HANDLE) handle); return (jboolean) CloseHandle((HANDLE) handle);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册