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

Issue 4313064: code review 4313064: gc: correctly handle fields of pointer type to recursiv... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 1 month ago by lstoakes
Modified:
1 year ago
Reviewers:
CC:
rsc, golang-dev_googlegroups.com
Visibility:
Public.

Description

gc: correctly handle fields of pointer type to recursive forward references

Previously, whether declaring a type which copied the structure of a type it was
referenced in via a pointer field would work depended on whether you declared it
before or after the type it copied, e.g. type T2 T1; type T1 struct { F *T2 }
would work, however type T1 struct { F *T2 }; type T2 T1 wouldn't.

Fixes issue 667.

Patch Set 1 #

Patch Set 2 : diff -r 1196d99743dd https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 1196d99743dd https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 1196d99743dd https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r f0f78e666988 https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 6 : diff -r 872404d61597 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 872404d61597 https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r 872404d61597 https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r 33fe8d22b2d2 https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 10 : diff -r de525810c69b https://go.googlecode.com/hg/ #

Patch Set 11 : diff -r de525810c69b https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/cmd/gc/dcl.c View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -7 lines 0 comments Download
M src/cmd/gc/go.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M src/cmd/gc/lex.c View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gc/typecheck.c View 1 2 3 4 5 6 7 8 9 10 4 chunks +28 lines, -1 line 0 comments Download
M src/cmd/gc/walk.c View 1 2 3 4 5 6 7 8 9 10 2 chunks +60 lines, -12 lines 0 comments Download
A test/fixedbugs/bug336.go View 1 2 3 4 5 6 7 8 9 1 chunk +86 lines, -0 lines 0 comments Download

Messages

Total messages: 28
lstoakes
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
1 year, 1 month ago #1
lstoakes
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
1 year, 1 month ago #2
lstoakes
Ack, we've got a problem when dealing with struct fields, delaying the walkdef() prevents us ...
1 year, 1 month ago #3
lstoakes
Ok, so a closer look reveals this is actually a problem with the patch in ...
1 year, 1 month ago #4
lstoakes
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
1 year, 1 month ago #5
lstoakes
Ok - I have now fixed the previous issues. Before I was deferring the walkdef() ...
1 year, 1 month ago #6
rsc
http://codereview.appspot.com/4313064/diff/12001/src/cmd/gc/typecheck.c File src/cmd/gc/typecheck.c (right): http://codereview.appspot.com/4313064/diff/12001/src/cmd/gc/typecheck.c#newcode35 src/cmd/gc/typecheck.c:35: static uchar isind; delete http://codereview.appspot.com/4313064/diff/12001/src/cmd/gc/typecheck.c#newcode145 src/cmd/gc/typecheck.c:145: if(isind && n->op ...
1 year, 1 month ago #7
lstoakes
I am out of country for a couple more days, so will be a slight ...
1 year, 1 month ago #8
lstoakes
Strict = struct. Using phone with autocorrect... On Thursday, 7 April 2011, Lorenzo Stoakes <lstoakes@gmail.com> ...
1 year, 1 month ago #9
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
1 year, 1 month ago #10
lstoakes
Ah, actually - I need to make a few more changes to get issue 1672 ...
1 year, 1 month ago #11
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
1 year, 1 month ago #12
lstoakes
All fixed up. We are now sometimes passing around the current 'top' value in typecheck(), ...
1 year, 1 month ago #13
lstoakes
Let me know if there is anything else you need on this; note that I ...
1 year, 1 month ago #14
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
1 year ago #15
lstoakes
Hi, Wondered whether there was any update on this patch? I don't mean to be ...
1 year ago #16
rsc
it's on a long but shrinking list
1 year ago #17
lstoakes
On 25 April 2011 16:43, Russ Cox <rsc@golang.org> wrote: > it's on a long but ...
1 year ago #18
rsc
http://codereview.appspot.com/4313064/diff/38001/src/cmd/gc/walk.c File src/cmd/gc/walk.c (right): http://codereview.appspot.com/4313064/diff/38001/src/cmd/gc/walk.c#newcode134 src/cmd/gc/walk.c:134: deferredtypecopy = list(deferredtypecopy, n); parallel lists always cause bugs. ...
1 year ago #19
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
1 year ago #20
rsc
http://codereview.appspot.com/4313064/diff/38001/src/cmd/gc/walk.c File src/cmd/gc/walk.c (right): http://codereview.appspot.com/4313064/diff/38001/src/cmd/gc/walk.c#newcode240 src/cmd/gc/walk.c:240: walkdef(Node *n, int top) On 2011/04/25 20:53:26, rsc wrote: ...
1 year ago #21
lstoakes
On 25 April 2011 21:53, <rsc@golang.org> wrote: > > http://codereview.appspot.com/4313064/diff/38001/src/cmd/gc/walk.c > File src/cmd/gc/walk.c (right): > ...
1 year ago #22
lstoakes
On 26 April 2011 17:10, <rsc@golang.org> wrote: > still applies Too quick for me :-) ...
1 year ago #23
lstoakes
On 26 April 2011 17:11, Lorenzo Stoakes <lstoakes@gmail.com> wrote: > See above note. However, there ...
1 year ago #24
lstoakes
On 26 April 2011 17:12, Lorenzo Stoakes <lstoakes@gmail.com> wrote: > However, there might be a ...
1 year ago #25
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
1 year ago #26
rsc
LGTM
1 year ago #27
rsc
1 year ago #28
*** Submitted as http://code.google.com/p/go/source/detail?r=3c73bb78da9a ***

gc: correctly handle fields of pointer type to recursive forward references

Previously, whether declaring a type which copied the structure of a type it was
referenced in via a pointer field would work depended on whether you declared it
before or after the type it copied, e.g. type T2 T1; type T1 struct { F *T2 }
would work, however type T1 struct { F *T2 }; type T2 T1 wouldn't.

Fixes issue 667.

R=rsc
CC=golang-dev
http://codereview.appspot.com/4313064

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 855:fffdfa546f68