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/internal/literals
Daniel Martí 691a44cecb avoid breaking const declarations using iotas
With the -literals flag, we try to convert some const declarations to
vars, as long as that doesn't break typechecking. We really only do that
for typed constant strings, really.

There was a quirk: if a numerical constant had a type and used iota, we
would not obfuscate its value, but we would still convert the
declaration from const to var. Since iotas only work within const
declarations, that would break compilation:

	> garble -literals build
	[stderr]
	# test/main
	FeWE3zwi.go:19: undefined: iota
	exit status 2

To fix the problem, make the logic more conservative: only obfuscate
constant declarations where the values are typed strings, meaning that
any numerical constants are left entirely untouched.

This fixes the build of google.golang.org/protobuf/runtime/protoiface
with -literals turned on.
4 years ago
..
literals.go avoid breaking const declarations using iotas 4 years ago
obfuscators.go if the seed is random and the build fails, print the seed (#213) 5 years ago
seed.go Replaced asthelper.Ident with ast.NewIdent 5 years ago
shuffle.go Replaced asthelper.Ident with ast.NewIdent 5 years ago
simple.go Replaced asthelper.Ident with ast.NewIdent 5 years ago
split.go Replaced asthelper.Ident with ast.NewIdent 5 years ago
swap.go Replaced asthelper.Ident with ast.NewIdent 5 years ago