aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-04-20 23:54:28 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-04-20 23:54:28 +0000
commitaa40ec9031076c07d84a1a60322e5bba66378782 (patch)
tree817bd94bc0001d9e94ecc0ef3389e83a095f19fe
parent0f79675b658bbf6871b720d7b662ddfb6cce1533 (diff)
downloadgdb-aa40ec9031076c07d84a1a60322e5bba66378782.zip
gdb-aa40ec9031076c07d84a1a60322e5bba66378782.tar.gz
gdb-aa40ec9031076c07d84a1a60322e5bba66378782.tar.bz2
* frame.c (find_saved_register): Avoid a NULL pointer
dereference and actually walk the frame list.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/frame.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 043cf34..4bc72c6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-20 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * frame.c (find_saved_register): Avoid a NULL pointer
+ dereference and actually walk the frame list.
+
2002-04-20 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (gdbarch_update_p): Keep the list of architectures
diff --git a/gdb/frame.c b/gdb/frame.c
index 7923660..819ee2c 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];