From aa40ec9031076c07d84a1a60322e5bba66378782 Mon Sep 17 00:00:00 2001 From: Jason Thorpe Date: Sat, 20 Apr 2002 23:54:28 +0000 Subject: [PATCH] * frame.c (find_saved_register): Avoid a NULL pointer dereference and actually walk the frame list. --- gdb/ChangeLog | 5 +++++ gdb/frame.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 043cf342c95..4bc72c60dbc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-04-20 Jason Thorpe + + * frame.c (find_saved_register): Avoid a NULL pointer + dereference and actually walk the frame list. + 2002-04-20 Andrew Cagney * gdbarch.sh (gdbarch_update_p): Keep the list of architectures diff --git a/gdb/frame.c b/gdb/frame.c index 7923660e1ab..819ee2cb017 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -83,9 +83,10 @@ find_saved_register (struct frame_info *frame, int regnum) while (1) { QUIT; - frame1 = get_next_frame (frame1); - if (frame1 == 0 || frame1 == frame) + frame1 = get_next_frame (frame); + if (frame1 == 0) break; + frame = frame1; FRAME_INIT_SAVED_REGS (frame1); if (frame1->saved_regs[regnum]) addr = frame1->saved_regs[regnum]; -- 2.30.2