/ go Public
cmd/compile: error line number reported is incorrect if it appears after line 0xFFFFF #36850
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
Create a valid
.gosource file that has more than
0xFFFFF). And add some "garbage" to the end of it to make it invalid, to make compilation fail. Attempting to build it (
go build big.go) or run it (
go run big.go) the go tool detects the error and displays an error message where the line number is capped at
Here's a simple Go app that creates a
big.gofile that has approximately twice as many rows (it has a raw string literal that has 2*0xFFFFF empty lines):
If we decrease the generated number of lines, e.g.:
We get the proper line number (
What did you expect to see?
I expected the proper line number to be printed where the error is detected (
2*0xFFFFFF+3 = 2097153):
What did you see instead?
The displayed error line number is improperly capped at
Note: This issue was reported on StackOverflow: https://stackoverflow.com/questions/59951140/go-compiler-error-line-number-is-incorrect
The text was updated successfully, but these errors were encountered: