summaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2006-04-28 04:07:33 +0000
committerAlan Modra <amodra@bigpond.net.au>2006-04-28 04:07:33 +0000
commit1b605af2f49a6f5a4cd4514950a338c775066097 (patch)
tree7960574ee8c48277f6abea30c99409e7eb05ef79 /gas/dwarf2dbg.c
parent38163dac0f398caa4b7c5fb0fa6892eb897ae35d (diff)
downloadbinutils-redhat-1b605af2f49a6f5a4cd4514950a338c775066097.tar.gz
* dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end
of list rather than beginning.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 81945280ae..16666fa4f2 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -209,21 +209,21 @@ get_line_subseg (segT seg, subsegT subseg)
static subsegT last_subseg;
static struct line_subseg *last_line_subseg;
- struct line_seg *s;
+ struct line_seg **ps, *s;
struct line_subseg **pss, *ss;
if (seg == last_seg && subseg == last_subseg)
return last_line_subseg;
- for (s = all_segs; s; s = s->next)
+ for (ps = &all_segs; (s = *ps) != NULL; ps = &s->next)
if (s->seg == seg)
goto found_seg;
s = (struct line_seg *) xmalloc (sizeof (*s));
- s->next = all_segs;
+ s->next = NULL;
s->seg = seg;
s->head = NULL;
- all_segs = s;
+ *ps = s;
found_seg:
for (pss = &s->head; (ss = *pss) != NULL ; pss = &ss->next)