mirror of https://github.com/golang/go.git
token.File.LineStart panics if line < 1, but we were checking line < 0. Surprising that this was not hit more often: it looks like we pre-validate input except for parsed positions coming from the Go command. It is possible that an older version of the Go command returned invalid positions. Also report a bug for one error condition in ToOffset: the position returned by LineStart should always be valid. Fixes golang/go#54006 Change-Id: I5965af9c62976b3e00b023512df334a8de943a3d Reviewed-on: https://go-review.googlesource.com/c/tools/+/419109 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> gopls-CI: kokoro <noreply+kokoro@google.com> |
||
|---|---|---|
| .. | ||
| parse.go | ||
| span.go | ||
| span_test.go | ||
| token.go | ||
| token_test.go | ||
| uri.go | ||
| uri_test.go | ||
| uri_windows_test.go | ||
| utf16.go | ||
| utf16_test.go | ||