-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: inconsistent NumStmt when //line clauses are used #27350
Comments
@gopherbot please file this to be considered for backport to 1.11. This is a regression. |
Backport issue(s) opened: #27397 (for 1.11). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
The problem doesn't seem to happen if the file is run through gofmt. |
* *: added support for storing checkpoint at local filesystem * config, tests: change default checkpoint driver to "file" * mydump: regenerate the parser to avoid golang/go#27350 during coverage * checkpoints: addressed comments
Change https://golang.org/cl/153061 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
I'm using Ragel to generate a lexer. Ragel includes
//line
clauses inthe generated code which help the Go compiler point back to the original
.rl
file when compilation fails.
If I run
ragel
to generate the code and try to profile the coverage of thegenerated code, the
go tool cover
command fails with the error,inconsistent NumStmt: changed from 2 to 3
.This has not been an issue in Go 1.5-1.10.
Here's a minimal (non-sensical) lexer for which I was able to reproduce this
issue.
The generated code from this lexer is available here:
https://play.golang.org/p/cTT82DxYCjB
To reproduce the issue locally, you'll need to place a
lex_test.go
file inthe same package. (It can be empty.)
I've also included a zip file containing all the required files and the
resulting cover.out on which
go tool cover
fails: repro.zip.I think this has something to do with the
//line
comments generated byRagel because upon removing them, everything works as expected.
What did you expect to see?
An HTML file containing the coverage report.
What did you see instead?
The following error message.
The text was updated successfully, but these errors were encountered: