Skip to content

Commit

Permalink
Merge pull request #16146 from tajila/loom
Browse files Browse the repository at this point in the history
Add missing NULL checks for threadholder in jvmti calls
  • Loading branch information
babsingh committed Oct 20, 2022
2 parents da2ecb9 + 8cf965f commit 0c7c064
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions runtime/jvmti/jvmtiThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ jvmtiGetThreadInfo(jvmtiEnv *env,
rv_name = name;
{
#if JAVA_SPEC_VERSION >= 19
if (isVirtual) {
if (isVirtual || (NULL == threadHolder)) {
rv_priority = JVMTI_THREAD_NORM_PRIORITY;
} else {
rv_priority = J9VMJAVALANGTHREADFIELDHOLDER_PRIORITY(currentThread, threadHolder);
Expand All @@ -593,7 +593,11 @@ jvmtiGetThreadInfo(jvmtiEnv *env,
if (isVirtual) {
rv_is_daemon = JNI_TRUE;
} else {
rv_is_daemon = J9VMJAVALANGTHREADFIELDHOLDER_DAEMON(currentThread, threadHolder) ? JNI_TRUE : JNI_FALSE;
if (NULL == threadHolder) {
rv_is_daemon = JNI_FALSE;
} else {
rv_is_daemon = J9VMJAVALANGTHREADFIELDHOLDER_DAEMON(currentThread, threadHolder) ? JNI_TRUE : JNI_FALSE;
}
}
#else /* JAVA_SPEC_VERSION >= 19 */
rv_is_daemon = J9VMJAVALANGTHREAD_ISDAEMON(currentThread, threadObject) ? JNI_TRUE : JNI_FALSE;
Expand Down

0 comments on commit 0c7c064

Please sign in to comment.