From 7ecd0eae8629b08f3af24927c11fd0429f70a3ee Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Thu, 30 Apr 2026 23:49:07 +0000 Subject: [PATCH] 8383550: AsyncExceptionHandshakeClosure::do_thread() should not be passed nullptr Reviewed-by: dholmes, pchilanomate --- src/hotspot/share/runtime/javaThread.inline.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/javaThread.inline.hpp b/src/hotspot/share/runtime/javaThread.inline.hpp index bffacef24d0..2c2ed2da2fa 100644 --- a/src/hotspot/share/runtime/javaThread.inline.hpp +++ b/src/hotspot/share/runtime/javaThread.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Azul Systems, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -91,10 +91,14 @@ class AsyncExceptionHandshakeClosure : public AsyncHandshakeClosure { } void do_thread(Thread* thr) { + PRAGMA_DIAG_PUSH + PRAGMA_NONNULL_IGNORED + // Suppress GCC warning for nonnull as it doesn't recognize that `thr` is always the current thread. JavaThread* self = JavaThread::cast(thr); assert(self == JavaThread::current(), "must be"); self->handle_async_exception(exception()); + PRAGMA_DIAG_POP } oop exception() { assert(!_exception.is_empty(), "invariant");