]> Cypherpunks repositories - gostls13.git/commit
go/printer: error out of Fprint when it would write a '//line' directive with a multi...
authorBryan C. Mills <bcmills@google.com>
Mon, 15 May 2023 15:34:46 +0000 (11:34 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 8 Jun 2023 01:52:35 +0000 (01:52 +0000)
commitb9baf4452fe949a5a159eec4d4a437ad2833ead1
tree156f0fa8425e980948fed1c5e4a43eb4f46d97b3
parent8bfe839c5f514ae7a466889d74262c9e7d89742f
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 #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>
src/go/printer/printer.go
src/go/printer/printer_test.go