]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: drop column info when line number saturates
authorKeith Randall <khr@golang.org>
Mon, 14 Feb 2022 22:57:55 +0000 (14:57 -0800)
committerKeith Randall <khr@golang.org>
Mon, 14 Feb 2022 23:50:26 +0000 (23:50 +0000)
commit1de2344af16125ae2fabed226f2fbb40a150238c
tree0d3af30921683b14561e85b6e01be5274ebd013c
parent1ed30ca537a05b887f8479027b6363a03f957610
cmd/compile: drop column info when line number saturates

When line number saturates, we can end up getting non-monotonic
position info, because the start of the next line after line=lineMax,col=2
is line=lineMax,col=1.

Instead, if line==lineMax, make the column always 0 (no column info).
If the line number is wrong, having column info probably isn't that helpful.

Fixes #51193

Change-Id: If3d90472691b1f6163654f3505e2cb98467f2383
Reviewed-on: https://go-review.googlesource.com/c/go/+/385795
Trust: Keith Randall <khr@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/internal/src/pos.go
src/cmd/internal/src/pos_test.go