commit | 613e530547549f4220c4571ea913acbe5fa56f72 | [log] [tgz] |
---|---|---|
author | Nikhil Benesch <nikhil.benesch@gmail.com> | Sun Oct 04 23:40:40 2020 -0400 |
committer | Ian Lance Taylor <iant@golang.org> | Tue Oct 06 20:52:52 2020 +0000 |
tree | beb9770d3f741632af6b0a28daf1a15210111cd7 | |
parent | d00febdab0535546ccbf1ef634be1f23b09c8b77 [diff] |
compiler: avoid undefined behavior in Import::read For some implementations of Stream, advancing the stream will invalidate the previously-returned peek buffer. Copy the peek buffer before advancing in Import::read to avoid this undefined behavior. Change-Id: Icfd56cf5e6f0d94a582d44e63bc51e75c24b8804 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/259438 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Than McIntosh <thanm@google.com>