]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.19] go/printer: error out of Fprint when it would write a '/...
authorBryan C. Mills <bcmills@google.com>
Mon, 15 May 2023 15:34:46 +0000 (11:34 -0400)
committerMichael Pratt <mpratt@google.com>
Tue, 13 Jun 2023 19:59:56 +0000 (19:59 +0000)
commit0b0f86e4c40c86750741e116690cd65b1cf49737
treeead9cb07058259e3e99e59dfa155e922da991e25
parent6d44c158a2accb4bf23e48ad7906f7cfccd8b5b3
[release-branch.go1.19] go/printer: error out of Fprint when it would write a '//line' directive with a multiline file path

Line directives do not provide a way to escape newline characters, so
source file paths containing newlines must not be written in them.

Updates #60515.
Updates #60167.

Change-Id: I30f8b381cc7d1df6914c27591544edf424a4b634
Reviewed-on: https://go-review.googlesource.com/c/go/+/501578
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit d1087efa42ea0b0f011283a87d7a732cba51e4ad)
Reviewed-on: https://go-review.googlesource.com/c/go/+/501823
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/go/printer/printer.go
src/go/printer/printer_test.go