diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index cafc9b10cbb05..2c5b7e771dc4a 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -1307,9 +1307,8 @@ bool os::is_first_C_frame(frame* fr) { uintptr_t old_sp = (uintptr_t)fr->sender_sp(); if ((uintptr_t)fr->sender_sp() == (uintptr_t)-1 || is_pointer_bad(fr->sender_sp())) return true; - uintptr_t old_fp = (uintptr_t)fr->link_or_null(); - if (old_fp == 0 || old_fp == (uintptr_t)-1 || old_fp == ufp || - is_pointer_bad(fr->link_or_null())) return true; + uintptr_t old_fp = (uintptr_t)fr->link(); + if (old_fp == 0 || old_fp == (uintptr_t)-1 || old_fp == ufp) return true; // stack grows downwards; if old_fp is below current fp or if the stack // frame is too large, either the stack is corrupted or fp is not saved @@ -1318,6 +1317,8 @@ bool os::is_first_C_frame(frame* fr) { if (old_fp < ufp) return true; if (old_fp - ufp > 64 * K) return true; + if (is_pointer_bad((intptr_t*) old_fp)) return true; + return false; }