diff --git a/src/hotspot/cpu/aarch64/frame_aarch64.cpp b/src/hotspot/cpu/aarch64/frame_aarch64.cpp index de369a1b6cd..62c1569395a 100644 --- a/src/hotspot/cpu/aarch64/frame_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/frame_aarch64.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved. + * Copyrithg (c) 2025, Datadog, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +85,8 @@ bool frame::safe_for_sender(JavaThread *thread) { // So unextended sp must be within the stack but we need not to check // that unextended sp >= sp - bool unextended_sp_safe = (unextended_sp < thread->stack_base()); + bool unextended_sp_safe = (unextended_sp < thread->stack_base() && \ + unextended_sp >= thread->stack_base() - thread->stack_size()); if (!unextended_sp_safe) { return false;