Descriptioncmd/cgo, debug/dwarf: fix translation of zero-size arrays
In cgo, now that recursive calls to typeConv.Type() always work,
we can more robustly calculate the array sizes based on the size
of our element type.
Also, in debug/dwarf, the decision to call zeroType is made
based on a type's usage within a particular struct, but dwarf.Type
values are cached in typeCache, so the modification might affect
uses of the type in other structs. Current compilers don't appear
to share DWARF type entries for "[]foo" and "[0]foo", but they also
don't consistently share type entries in other cases. Arguably
modifying the types is an improvement in some cases, but varying
translated types according to compiler whims seems like a bad idea.
Lastly, also in debug/dwarf, zeroType only needs to rewrite the
top-level dimension, and only if the rest of the array size is
non-zero.
Fixes issue 8428.
Patch Set 1 #Patch Set 2 : diff -r 58026885ac66 https://code.google.com/p/go #Patch Set 3 : diff -r 6316af2a3b922fa9515e0ddd6edfa04922abef00 https://code.google.com/p/go #Patch Set 4 : diff -r 6316af2a3b922fa9515e0ddd6edfa04922abef00 https://code.google.com/p/go #Patch Set 5 : diff -r 6316af2a3b922fa9515e0ddd6edfa04922abef00 https://code.google.com/p/go #Patch Set 6 : diff -r 6316af2a3b922fa9515e0ddd6edfa04922abef00 https://code.google.com/p/go #Patch Set 7 : diff -r 6316af2a3b922fa9515e0ddd6edfa04922abef00 https://code.google.com/p/go #
MessagesTotal messages: 7
|