* [PATCH] source.c, find_source_lines
@ 2007-08-11 20:53 msnyder
2007-08-13 21:29 ` Jim Blandy
0 siblings, 1 reply; 3+ messages in thread
From: msnyder @ 2007-08-11 20:53 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 103 bytes --]
Since 's' is repeatedly assumed, let's assert it rather than
sometimes checking it and sometimes not.
[-- Attachment #2: 57.txt --]
[-- Type: text/plain, Size: 1145 bytes --]
2007-08-11 Michael Snyder <msnyder@access-company.com>
* source.c (find_source_lines): Require symtab 's'.
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.80
diff -p -r1.80 source.c
*** source.c 28 Jun 2007 22:14:06 -0000 1.80
--- source.c 11 Aug 2007 20:46:35 -0000
*************** find_source_lines (struct symtab *s, int
*** 1122,1132 ****
long mtime = 0;
int size;
line_charpos = (int *) xmalloc (lines_allocated * sizeof (int));
if (fstat (desc, &st) < 0)
perror_with_name (s->filename);
! if (s && s->objfile && s->objfile->obfd)
mtime = bfd_get_mtime (s->objfile->obfd);
else if (exec_bfd)
mtime = bfd_get_mtime (exec_bfd);
--- 1122,1133 ----
long mtime = 0;
int size;
+ gdb_assert (s);
line_charpos = (int *) xmalloc (lines_allocated * sizeof (int));
if (fstat (desc, &st) < 0)
perror_with_name (s->filename);
! if (s->objfile && s->objfile->obfd)
mtime = bfd_get_mtime (s->objfile->obfd);
else if (exec_bfd)
mtime = bfd_get_mtime (exec_bfd);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] source.c, find_source_lines
2007-08-11 20:53 [PATCH] source.c, find_source_lines msnyder
@ 2007-08-13 21:29 ` Jim Blandy
2007-08-13 22:25 ` msnyder
0 siblings, 1 reply; 3+ messages in thread
From: Jim Blandy @ 2007-08-13 21:29 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches
msnyder@sonic.net writes:
> Since 's' is repeatedly assumed, let's assert it rather than
> sometimes checking it and sometimes not.
Yeah... I don't see what this function would even be intended to do
when passed NULL.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] source.c, find_source_lines
2007-08-13 21:29 ` Jim Blandy
@ 2007-08-13 22:25 ` msnyder
0 siblings, 0 replies; 3+ messages in thread
From: msnyder @ 2007-08-13 22:25 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb-patches
>
> msnyder@sonic.net writes:
>> Since 's' is repeatedly assumed, let's assert it rather than
>> sometimes checking it and sometimes not.
>
> Yeah... I don't see what this function would even be intended to do
> when passed NULL.
Thanks, committed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-13 22:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-11 20:53 [PATCH] source.c, find_source_lines msnyder
2007-08-13 21:29 ` Jim Blandy
2007-08-13 22:25 ` msnyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox