]> Cypherpunks repositories - gostls13.git/commitdiff
keep line number history even when
authorRuss Cox <rsc@golang.org>
Sat, 31 Jan 2009 01:10:10 +0000 (17:10 -0800)
committerRuss Cox <rsc@golang.org>
Sat, 31 Jan 2009 01:10:10 +0000 (17:10 -0800)
throwing away dead code at end of file.

also fix an uninitialized memory error
found by valgrind.

R=r
DELTA=7  (5 added, 2 deleted, 0 changed)
OCL=23991
CL=23994

src/cmd/6l/obj.c
src/cmd/6l/span.c

index 076809aa2fb249ac4a0279aeb7b1868c55c033eb..a23e030f597a6b21a43dff99610352fdd17141a1 100644 (file)
@@ -757,6 +757,7 @@ addhist(int32 line, int type)
        u->link = curhist;
        curhist = u;
 
+       s->name[0] = 0;
        j = 1;
        for(i=0; i<histfrogp; i++) {
                k = histfrog[i]->value;
@@ -764,6 +765,8 @@ addhist(int32 line, int type)
                s->name[j+1] = k;
                j += 2;
        }
+       s->name[j] = 0;
+       s->name[j+1] = 0;
 }
 
 void
index 8ac0543a88ebb037bc40d13aa1bee873f12f99c7..fea4979e42236bc6e44d82f7d02016f96db1d02a 100644 (file)
@@ -240,8 +240,6 @@ asmsym(void)
 
        for(p=textp; p!=P; p=p->pcond) {
                s = p->from.sym;
-               if(s->type != STEXT)
-                       continue;
 
                /* filenames first */
                for(a=p->to.autom; a; a=a->link)
@@ -251,6 +249,8 @@ asmsym(void)
                        if(a->type == D_FILE1)
                                putsymb(a->asym->name, 'Z', a->aoffset, 0, nil);
 
+               if(s->type != STEXT)
+                       continue;
                putsymb(s->name, 'T', s->value, s->version, gotypefor(s->name));
 
                /* frame, auto and param after */