]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] 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)
committerGopher Robot <gobot@golang.org>
Tue, 20 Jun 2023 00:36:19 +0000 (00:36 +0000)
commitd51e322a3f98e8ceddfd203afcbf0144121d5cc1
tree8aa7c6d5d47ee325fc92736ccdb76c879039e8c2
parent49594244d388401a2cec34ab22d28f4e66d46de1
[release-branch.go1.20] 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 #60516.
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/+/501819
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/go/printer/printer.go
src/go/printer/printer_test.go