]> Cypherpunks repositories - gostls13.git/commit
cmd/cover: fix buglets in counter insertion
authorThan McIntosh <thanm@google.com>
Fri, 21 Oct 2022 16:57:21 +0000 (12:57 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 21 Oct 2022 19:42:51 +0000 (19:42 +0000)
commite43eebdab8a6df71e4b5262bcfb650ee8439870f
treec65a1c33dd90b3e740d2aafcb8a63144457ce96d
parent67403a30f61ac6af584796cdfd45c0d86820690c
cmd/cover: fix buglets in counter insertion

This patch has a couple of minor fixes to new-style counter insertion
(noticed these problems while working on the fix for issue 56370).

First, make sure that the function registration sequence (writing of
nctrs, pkgid, funcid to counter var prolog) comes prior to the first
counter update (they were reversed up to this point, due to an
artifact of the way cmd/internal/edit operates).

Second, fix up "per function" counter insertion mode (an experimental
feature disabled by default that adds just a single counter to each
function as opposed to one per basic block), which was failing to
insert the single counter in the right place.

Change-Id: Icfb613ca385647f35c0e52da2da8edeb2a506ab7
Reviewed-on: https://go-review.googlesource.com/c/go/+/444835
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>
src/cmd/cover/cfg_test.go
src/cmd/cover/cover.go