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

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:
13 years ago by lstoakes
Modified:
12 years, 12 months ago
Reviewers:
CC:
rsc, golang-dev
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 (+181 lines, -20 lines) 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/
13 years ago (2011-03-31 23:01:02 UTC) #1
lstoakes
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years ago (2011-03-31 23:36:38 UTC) #2
lstoakes
Ack, we've got a problem when dealing with struct fields, delaying the walkdef() prevents us ...
13 years ago (2011-04-01 00:57:18 UTC) #3
lstoakes
Ok, so a closer look reveals this is actually a problem with the patch in ...
13 years ago (2011-04-01 01:03:44 UTC) #4
lstoakes
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years ago (2011-04-03 01:06:13 UTC) #5
lstoakes
Ok - I have now fixed the previous issues. Before I was deferring the walkdef() ...
13 years ago (2011-04-03 01:11:45 UTC) #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 ...
13 years ago (2011-04-07 16:56:34 UTC) #7
lstoakes
I am out of country for a couple more days, so will be a slight ...
13 years ago (2011-04-07 18:18:25 UTC) #8
lstoakes
Strict = struct. Using phone with autocorrect... On Thursday, 7 April 2011, Lorenzo Stoakes <lstoakes@gmail.com> ...
13 years ago (2011-04-07 18:19:05 UTC) #9
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years ago (2011-04-10 16:05:07 UTC) #10
lstoakes
Ah, actually - I need to make a few more changes to get issue 1672 ...
13 years ago (2011-04-11 10:59:05 UTC) #11
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years ago (2011-04-11 11:37:54 UTC) #12
lstoakes
All fixed up. We are now sometimes passing around the current 'top' value in typecheck(), ...
13 years ago (2011-04-11 11:44:43 UTC) #13
lstoakes
Let me know if there is anything else you need on this; note that I ...
13 years ago (2011-04-14 12:08:17 UTC) #14
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years ago (2011-04-19 17:13:57 UTC) #15
lstoakes
Hi, Wondered whether there was any update on this patch? I don't mean to be ...
12 years, 12 months ago (2011-04-25 15:09:29 UTC) #16
rsc
it's on a long but shrinking list
12 years, 12 months ago (2011-04-25 15:43:56 UTC) #17
lstoakes
On 25 April 2011 16:43, Russ Cox <rsc@golang.org> wrote: > it's on a long but ...
12 years, 12 months ago (2011-04-25 16:10:25 UTC) #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. ...
12 years, 12 months ago (2011-04-25 20:53:26 UTC) #19
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 12 months ago (2011-04-26 16:07:24 UTC) #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: ...
12 years, 12 months ago (2011-04-26 16:10:42 UTC) #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): > ...
12 years, 12 months ago (2011-04-26 16:10:57 UTC) #22
lstoakes
On 26 April 2011 17:10, <rsc@golang.org> wrote: > still applies Too quick for me :-) ...
12 years, 12 months ago (2011-04-26 16:11:32 UTC) #23
lstoakes
On 26 April 2011 17:11, Lorenzo Stoakes <lstoakes@gmail.com> wrote: > See above note. However, there ...
12 years, 12 months ago (2011-04-26 16:12:30 UTC) #24
lstoakes
On 26 April 2011 17:12, Lorenzo Stoakes <lstoakes@gmail.com> wrote: > However, there might be a ...
12 years, 12 months ago (2011-04-26 16:24:47 UTC) #25
lstoakes
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 12 months ago (2011-04-26 16:57:39 UTC) #26
rsc
LGTM
12 years, 12 months ago (2011-04-28 03:58:24 UTC) #27
rsc
12 years, 12 months ago (2011-04-28 04:13:52 UTC) #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 f62528b