From: Ian Lance Taylor Date: Thu, 21 Apr 2011 15:32:58 +0000 (-0700) Subject: runtime: skip functions with no lines when building src line table X-Git-Tag: weekly.2011-04-27~80 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1f09cc25a16ab8f752e79379bc86fe126d2be08f;p=gostls13.git runtime: skip functions with no lines when building src line table 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 --- diff --git a/src/pkg/runtime/symtab.c b/src/pkg/runtime/symtab.c index 6f0eea0e76..da4579734f 100644 --- a/src/pkg/runtime/symtab.c +++ b/src/pkg/runtime/symtab.c @@ -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