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/testdata/scripts
Daniel Martí 05d35350cf record types into ignoreObjects more reliably
Our previous logic only took care of fairly simple types, such as a
simple struct or a pointer to a struct. If we had a struct embedding
another struct, we'd fail to record the objects for the fields in the
inner struct, and that would lead to miscompilation:

	> garble build
	[stderr]
	# test/main
	LZmt64Nm.go:7: outer.InnerField undefined (type *CcUt1wkQ.EmbeddingOuter has no field or method InnerField)

To fix this issue, make the function that records all objects under a
types.Type smarter. Since it now does more than just dealing with
structs, it's also renamed.

Since the function now walks types properly, we get to remove the extra
ast.Inspect in recordReflectArgs, which is nice.

We also make it a method, to avoid the map parameter. A boolean
parameter is also added, since we need this feature to only look at the
current package when looking at reflect calls.

Finally, we add a test case, a simplified version of the original bug
report.

Fixes #315.
4 years ago
..
asm.txt obfuscate asm function names as well (#273) 4 years ago
basic.txt testdata: reduce the cost of short tests 4 years ago
cgo.txt all: drop support for Go 1.15.x (#265) 4 years ago
crossbuild.txt wrap types.Importer to canonicalize import paths 4 years ago
debugdir.txt refactor "current package" with TOOLEXEC_IMPORTPATH (#266) 4 years ago
embed.txt don't obfuscate the "embed" import path 4 years ago
goprivate.txt obfuscate asm function names as well (#273) 4 years ago
goversion.txt use "go env -json" to collect env info all at once 4 years ago
help.txt make "help" refuse arguments for now 4 years ago
implement.txt all: drop support for Go 1.15.x (#265) 4 years ago
imports.txt all: drop support for Go 1.15.x (#265) 4 years ago
init.txt all: drop support for Go 1.15.x (#265) 4 years ago
ldflags.txt testdata: remove some unnecessary execs (#267) 4 years ago
linkname.txt Fix calls to linkname functions (#314) 4 years ago
literals.txt make -literals succeed on all of std 4 years ago
modinfo.txt testdata: remove some unnecessary execs (#267) 4 years ago
plugin.txt all: drop support for Go 1.15.x (#265) 4 years ago
position.txt improve "reverse" even further (#289) 4 years ago
reverse.txt testdata: reduce the cost of short tests 4 years ago
seed.txt make flags like -literals and GOPRIVATE affect hashing (#288) 4 years ago
syntax.txt record types into ignoreObjects more reliably 4 years ago
test.txt testdata: reduce the cost of short tests 4 years ago
tiny.txt use hashWith for obfuscation position information 4 years ago