Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4609)

Issue 127980043: code review 127980043: cmd/cgo, debug/dwarf: fix translation of zero-size arrays (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by mdempsky
Modified:
9 years, 8 months ago
Reviewers:
rsc, iant
CC:
iant, golang-codereviews, r
Visibility:
Public.

Description

cmd/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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -57 lines) Patch
A misc/cgo/test/issue8428.go View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download
M src/cmd/cgo/gcc.go View 1 2 3 4 5 4 chunks +31 lines, -34 lines 0 comments Download
M src/pkg/debug/dwarf/type.go View 1 2 3 4 6 chunks +29 lines, -23 lines 0 comments Download

Messages

Total messages: 7
mdempsky
Hello iant (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
9 years, 8 months ago (2014-08-13 04:47:42 UTC) #1
mdempsky
On 2014/08/13 04:47:42, mdempsky wrote: > Hello iant (cc: mailto:golang-codereviews@googlegroups.com), > > I'd like you ...
9 years, 8 months ago (2014-08-13 04:51:57 UTC) #2
iant
LGTM Thanks.
9 years, 8 months ago (2014-08-13 18:16:26 UTC) #3
iant
*** Submitted as https://code.google.com/p/go/source/detail?r=132f262db488 *** cmd/cgo, debug/dwarf: fix translation of zero-size arrays In cgo, now ...
9 years, 8 months ago (2014-08-13 18:16:34 UTC) #4
rsc
mdempsky - The new test with [0] arrays breaks on OS X Lion. Rob just ...
9 years, 8 months ago (2014-08-28 23:32:17 UTC) #5
r
bismarck=% echo $GOARCH $GOOS; uname -a amd64 darwin Darwin bismarck.local 11.4.2 Darwin Kernel Version 11.4.2: ...
9 years, 8 months ago (2014-08-28 23:34:02 UTC) #6
mdempsky
9 years, 8 months ago (2014-08-28 23:34:18 UTC) #7
Message was sent while issue was closed.
On 2014/08/28 23:32:17, rsc wrote:
> Could you take a look?

Will do.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b