This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] buildsym.c, guard against null pointer.
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: ezannoni at redhat dot com
- Date: Tue, 21 May 2002 18:30:58 -0700
- Subject: [RFA] buildsym.c, guard against null pointer.
Elena,
I came upon this whilst debugging C++ in COFF. I don't know
why the null pointer came along, but this at least prevents
gdb from dumping core.
2002-05-21 Michael Snyder <msnyder@redhat.com>
* buildsym.c (finish_block): Guard against null pointer.
Index: buildsym.c
===================================================================
RCS file: /cvs/src/src/gdb/buildsym.c,v
retrieving revision 1.16
diff -p -r1.16 buildsym.c
*** buildsym.c 15 May 2002 21:19:18 -0000 1.16
--- buildsym.c 22 May 2002 01:42:55 -0000
*************** finish_block (struct symbol *symbol, str
*** 387,393 ****
start of this scope that don't have superblocks yet. */
opblock = NULL;
! for (pblock = pending_blocks; pblock != old_blocks; pblock = pblock->next)
{
if (BLOCK_SUPERBLOCK (pblock->block) == NULL)
{
--- 387,395 ----
start of this scope that don't have superblocks yet. */
opblock = NULL;
! for (pblock = pending_blocks;
! pblock && pblock != old_blocks;
! pblock = pblock->next)
{
if (BLOCK_SUPERBLOCK (pblock->block) == NULL)
{