]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: skip functions with no lines when building src line table
authorIan Lance Taylor <iant@golang.org>
Thu, 21 Apr 2011 15:32:58 +0000 (08:32 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 21 Apr 2011 15:32:58 +0000 (08:32 -0700)
Avoid getting out of synch when a function, such as main.init,
has no associated line number information.  Without this the
function before main.init can skip the PC all the way to the
next function, which will cause the next function's line table
to be associated with main.init, and leave subsequent
functions with the wrong line numbers.

R=rsc
CC=golang-dev
https://golang.org/cl/4426055

src/pkg/runtime/symtab.c

index 6f0eea0e76728bc404bcfb4bbb60f7a52b7bde1b..da4579734fda4ad0ea4cfe6ceeb4b860e1789381 100644 (file)
@@ -291,7 +291,9 @@ splitpcln(void)
                if(f < ef && pc >= (f+1)->entry) {
                        f->pcln.len = p - f->pcln.array;
                        f->pcln.cap = f->pcln.len;
-                       f++;
+                       do
+                               f++;
+                       while(f < ef && pc >= (f+1)->entry);
                        f->pcln.array = p;
                        // pc0 and ln0 are the starting values for
                        // the loop over f->pcln, so pc must be