* dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end
authorAlan Modra <amodra@gmail.com>
Fri, 28 Apr 2006 04:07:33 +0000 (04:07 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 28 Apr 2006 04:07:33 +0000 (04:07 +0000)
of list rather than beginning.

gas/ChangeLog
gas/dwarf2dbg.c

index c66dc6294f18d146e0fdea2cbf1adb73d4abe695..4f617a7f5c7be69abedfa84a014ce10fcdcbfdf3 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-28  Alan Modra  <amodra@bigpond.net.au>
+
+       * dwarf2dbg.c (get_line_subseg): Attach new struct line_seg to end
+       of list rather than beginning.
+
 2006-04-26  Julian Brown  <julian@codesourcery.com>
 
        * gas/config/tc-arm.c (neon_is_quarter_float): Move, and rename to...
index 81945280aec130093e59f05d62e6ee43c6d14dbe..16666fa4f28d9ed639c3ce8c554ef17000395332 100644 (file)
@@ -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)
This page took 0.026094 seconds and 4 git commands to generate.