This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] buildsym.c, guard against null pointer.
- From: Michael Snyder <msnyder at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 10 Sep 2002 16:46:02 -0700
- Subject: Re: [RFA] buildsym.c, guard against null pointer.
- Organization: Red Hat, Inc.
- References: <200205220130.g4M1UwG03569@reddwarf.sfbay.redhat.com>
Michael Snyder wrote:
>
> 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.
Committed.
>
> 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)
> {