From 859a5877c950205ab200fa4042e8450b5a77a77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 12 Feb 2023 21:39:42 +0000 Subject: [PATCH] internal/literals: re-enable the seed obfuscator Now that we dropped Go 1.19, we can use it again, since the referenced bug was fixed in Go 1.20. This is a separate commit, as this change does alter the way we obfuscate Go builds, so it's not just a cleanup. --- internal/literals/obfuscators.go | 2 +- testdata/script/literals.txtar | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/literals/obfuscators.go b/internal/literals/obfuscators.go index dc026ac..228fe6c 100644 --- a/internal/literals/obfuscators.go +++ b/internal/literals/obfuscators.go @@ -22,7 +22,7 @@ var ( swap{}, split{}, shuffle{}, - // seed{}, TODO: re-enable once https://go.dev/issue/47631 is fixed in Go 1.20 + seed{}, } TestObfuscator string diff --git a/testdata/script/literals.txtar b/testdata/script/literals.txtar index a0e21c0..b4813c9 100644 --- a/testdata/script/literals.txtar +++ b/testdata/script/literals.txtar @@ -44,9 +44,8 @@ grep '^\s+\w+ \^= \w+ \* \w+$' debug1/test/main/extra_literals.go # Note that the line obfuscator adds an inline comment before the call. grep '^\s+\w+ = .*\bappend\(\w+,(\s+\w+\[\d+\][\^\-+]\w+\[\d+\],?)+\)$' debug1/test/main/extra_literals.go -# TODO: re-enable once https://github.com/golang/go/issues/47631 is fixed # XorSeed obfuscator. Detect type decFunc func(byte) decFunc -# grep '^\s+type \w+ func\(byte\) \w+$' debug1/test/main/extra_literals.go +grep '^\s+type \w+ func\(byte\) \w+$' debug1/test/main/extra_literals.go # Finally, sanity check that we can build all of std with -literals. # Analogous to gogarble.txt.