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.
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 | 4 years ago | |
basic.txt | 4 years ago | |
cgo.txt | 4 years ago | |
crossbuild.txt | 4 years ago | |
debugdir.txt | 4 years ago | |
embed.txt | 4 years ago | |
goprivate.txt | 4 years ago | |
goversion.txt | 4 years ago | |
help.txt | 4 years ago | |
implement.txt | 4 years ago | |
imports.txt | 4 years ago | |
init.txt | 4 years ago | |
ldflags.txt | 4 years ago | |
linkname.txt | 4 years ago | |
literals.txt | 4 years ago | |
modinfo.txt | 4 years ago | |
plugin.txt | 4 years ago | |
position.txt | 4 years ago | |
reverse.txt | 4 years ago | |
seed.txt | 4 years ago | |
syntax.txt | 4 years ago | |
test.txt | 4 years ago | |
tiny.txt | 4 years ago |