diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index c302a5d031ca3..11dbead5d39ed 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -156,13 +156,10 @@ int os::get_native_stack(address* stack, int frames, int toSkip) { stack[frame_idx ++] = fr.pc(); } if (fr.fp() == nullptr || fr.cb() != nullptr || - fr.sender_pc() == nullptr || os::is_first_C_frame(&fr)) break; - - if (fr.sender_pc() && !os::is_first_C_frame(&fr)) { - fr = os::get_sender_for_C_frame(&fr); - } else { + fr.sender_pc() == nullptr || os::is_first_C_frame(&fr)) { break; } + fr = os::get_sender_for_C_frame(&fr); } num_of_frames = frame_idx; for (; frame_idx < frames; frame_idx ++) {