From: Rob Pike Date: Wed, 24 Sep 2008 17:35:59 +0000 (-0700) Subject: bug: updated wrong counter when combining values X-Git-Tag: weekly.2009-11-06~3134 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c79dffd5ef9c45d2e8e85072fa7611488c66cf74;p=gostls13.git bug: updated wrong counter when combining values R=rsc OCL=15751 CL=15751 --- diff --git a/src/cmd/prof/main.c b/src/cmd/prof/main.c index cd708e96f7..0712c7b673 100644 --- a/src/cmd/prof/main.c +++ b/src/cmd/prof/main.c @@ -252,7 +252,7 @@ dumphistogram() x = pcs[i]; func(b2, sizeof(b2), x->pc); if(j > 0 && strcmp(b1, b2) == 0) { - pcs[i-1]->count += x->count; + pcs[j-1]->count += x->count; } else { strcpy(b1, b2); pcs[j++] = x;