Descriptioncgo: fix dwarf type parsing
The recursive algorithm used to parse types in cgo
has a bug related to building the C type representation.
As an example, when the recursion starts at a type *T,
the C type representation won't be known until type T
itself is parsed. But then, it is possible that type T
references the type **T internally. The latter
representation is built based on the one of *T, which
started the recursion, so it won't attempt to parse it
again, and will instead use the current representation
value for *T, which is still empty at this point.
This problem was fixed by introducing a simple TypeRepr
type which builds the string representation lazily,
analogous to how the Go type information is built within
the same algorithm. This way, even if a type
representation is still unknown at some level in the
recursion, representations dependant on it can still
be created correctly.
Patch Set 1 #Patch Set 2 : diff -r 03da6860bb39 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 03da6860bb39 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r 03da6860bb39 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 5 : diff -r 6e0c3b77928a https://go.googlecode.com/hg/ #
MessagesTotal messages: 3
|