]> Cypherpunks repositories - gostls13.git/commit
cmd/cover: handle gotos
authorRob Pike <r@golang.org>
Thu, 13 Oct 2016 02:51:02 +0000 (19:51 -0700)
committerRob Pike <r@golang.org>
Fri, 14 Oct 2016 23:38:29 +0000 (23:38 +0000)
commitbe48aa3f3a16006ab31c424487af352ca374afed
treeb58868fdec6baaa52904835ccf6262606cdde415
parent5567b878915f7c2f1e7ee3898125c2cd2b7fe287
cmd/cover: handle gotos

If a labeled statement is the target of a goto, we must treat it as the
boundary of a new basic block, but only if it is not already the boundary
of a basic block such as a labeled for loop.

Fixes #16624

Now reports 100% coverage for the test in the issue.

Change-Id: If118bb6ff53a96c738e169d92c03cb3ce97bad0e
Reviewed-on: https://go-review.googlesource.com/30977
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/cover/cover.go
src/cmd/cover/testdata/test.go