You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/scripts/cached_modfiles
Daniel Martí 60dbece24f work around another go/printer bug to fix andybalholm/brotli
When obfuscating the following piece of code:

	func issue_573(s struct{ f int }) {
		var _ *int = &s.f
		/*x*/
	}

the function body would roughly end up printed as:
we would roughly end up with:

	var _ *int = &dZ4xYx3N
	/*x*/.rbg1IM3V

Note that the /*x*/ comment got moved earlier in the source code.
This happens because the new identifiers are longer, so the printer
thinks that the selector now ends past the comment.

That would be fine - we don't really mind where comments end up,
because these non-directive comments end up being removed anyway.

However, the resulting syntax is wrong, as the period for the selector
must be on the first line rather than the second.
This is a go/printer bug that we should fix upstream,
but until then, we must work around it in Go 1.18.x and 1.19.x.

The fix is somewhat obvious in hindsight. To reduce the chances that
go/printer will trip over comments and produce invalid syntax,
get rid of most comments before we use the printer.
We still keep the removal of comments after printing,
since go/printer consumes some comments in ast.Node Doc fields.

Add the minimized unit test case above, and add the upstream project
that found this bug to check-third-party.
andybalholm/brotli helps cover a compression algorithm and ccgo code
generation from C to Go, and it's also a fairly popular module,
particular with HTTP implementations which want pure-Go brotli.

While here, fix the check-third-party script: it was setting GOFLAGS
a bit too late, so it may run `go get` on the wrong mod file.

Fixes #573.
2 years ago
..
github.com_andybalholm_brotli_v1.0.4.mod work around another go/printer bug to fix andybalholm/brotli 2 years ago
github.com_andybalholm_brotli_v1.0.4.sum work around another go/printer bug to fix andybalholm/brotli 2 years ago
github.com_samber_lo_v1.21.0.mod work around another go/printer bug to fix andybalholm/brotli 2 years ago
github.com_samber_lo_v1.21.0.sum start checking some third party builds for regressions 2 years ago
golang.zx2c4.com_wireguard_0.0.20220316.mod work around another go/printer bug to fix andybalholm/brotli 2 years ago
golang.zx2c4.com_wireguard_0.0.20220316.sum start checking some third party builds for regressions 2 years ago