Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cover: internal error: overlapping blocks for func in for clause #10269

Closed
dvyukov opened this issue Mar 27, 2015 · 2 comments
Closed

cmd/cover: internal error: overlapping blocks for func in for clause #10269

dvyukov opened this issue Mar 27, 2015 · 2 comments
Assignees
Milestone

Comments

@dvyukov
Copy link
Member

@dvyukov dvyukov commented Mar 27, 2015

I am on commit c754be8.

Add the following file:

$ cat src/cmd/internal/obj/arm64/arm64_test.go

package arm64
import "testing"
func TestTest(t *testing.T) {} 

Then:

$ go test -c -cover cmd/internal/obj/arm64
cover: internal error: block 60 overlaps block 62
    src/cmd/internal/obj/arm64/obj7.go:#8196,#8260 src/cmd/internal/obj/arm64/obj7.go:#8237,#8256
@dvyukov dvyukov added this to the Go1.5 milestone Mar 27, 2015
@dvyukov dvyukov added the repo-tools label Mar 27, 2015
@robpike
Copy link
Contributor

@robpike robpike commented Mar 30, 2015

The contents of the added file above is irrelevant. Its only purpose, being the first test file in the directory, is to trigger the coverage rewrite.

Here is a self-contained simple example of the problem

% cat x.go
package x

func x() {
for ; ; (func() {})() {
}
}
% go tool cover -mode=set x.go > /dev/null
cover: internal error: block 0 overlaps block 1
x.go:#20,#45 x.go:#39,#41
%

@robpike robpike closed this Mar 30, 2015
@robpike robpike reopened this Mar 30, 2015
@robpike robpike changed the title cmd/cover: internal error: block 60 overlaps block 62 cmd/cover: internal error: overlapping blocks for func in for clause Mar 30, 2015
robpike added a commit that referenced this issue Mar 30, 2015
A residue of the automatic translation, this closure is easily rewritten
to a simpler, smaller, and faster construct.

Discovered while analyzing #10269, which I still plan to fix.

Change-Id: I76b12290280d81880c446b4cf75da633a94482d4
Reviewed-on: https://go-review.googlesource.com/8270
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
@robpike
Copy link
Contributor

@robpike robpike commented Mar 31, 2015

@robpike robpike closed this Mar 31, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.