diff options
author | Nick Clifton <nickc@redhat.com> | 2001-04-25 09:11:31 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-04-25 09:11:31 +0000 |
commit | ea3b9044a6a4a86bf3c1208e68499e145fedf9d8 (patch) | |
tree | c15e18b6dbaf11c3f728b6e3826947060e4674f4 /gas/config/obj-coff.c | |
parent | d6d788bdf3e7620bf744f4909e75d9a7857645c9 (diff) | |
download | gdb-ea3b9044a6a4a86bf3c1208e68499e145fedf9d8.zip gdb-ea3b9044a6a4a86bf3c1208e68499e145fedf9d8.tar.gz gdb-ea3b9044a6a4a86bf3c1208e68499e145fedf9d8.tar.bz2 |
Check to see if the filename symbol has been initialised before extracting
its symbol index.
Diffstat (limited to 'gas/config/obj-coff.c')
-rw-r--r-- | gas/config/obj-coff.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 2527fef..37aa640 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -2076,7 +2076,7 @@ fill_section (abfd, h, file_cursor) if (s->s_name[0]) { fragS *frag = segment_info[i].frchainP->frch_root; - char *buffer; + char *buffer = NULL; if (s->s_size == 0) s->s_scnptr = 0; @@ -3350,12 +3350,13 @@ do_linenos_for (abfd, h, file_cursor) line_ptr != (struct lineno_list *) NULL; line_ptr = line_ptr->next) { - if (line_ptr->line.l_lnno == 0) { - /* Turn a pointer to a symbol into the symbols' index */ - line_ptr->line.l_addr.l_symndx = - ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; + /* Turn a pointer to a symbol into the symbols' index, + provided that it has been initialised. */ + if (line_ptr->line.l_addr.l_symndx) + line_ptr->line.l_addr.l_symndx = + ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; } else { |