]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refilling
authorMatthew Dempsky <mdempsky@google.com>
Tue, 19 Sep 2017 21:28:03 +0000 (14:28 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 20:23:03 +0000 (20:23 +0000)
commit1ded8334f7e99f6fd9284dd71f9fcf72da10c3c8
tree200cda88886563d6f2940c225beec2367f265dfb
parentff8289f87936bd840daf6e704885f62399d01126
[release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refilling

The previous code seems to have an off-by-1 in it somewhere, the
consequence being that we didn't properly preserve all of the old
buffer contents that we intended to.

After spending a while looking at the existing window-shifting logic,
I wasn't able to understand exactly how it was supposed to work or
where the issue was, so I rewrote it to be (at least IMO) more
obviously correct.

Fixes #21938.

Change-Id: I1ed7bbc1e1751a52ab5f7cf0411ae289586dc345
Reviewed-on: https://go-review.googlesource.com/64830
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-on: https://go-review.googlesource.com/70977
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/syntax/scanner_test.go
src/cmd/compile/internal/syntax/source.go