diff options
| author | Russ Cox <rsc@golang.org> | 2009-12-03 01:12:02 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-12-03 01:12:02 -0800 |
| commit | 78c64cbc52cebee45bc44ab09f172571514fc83f (patch) | |
| tree | f4612be11e407e0e7bb3bc14823cc23580515006 /src | |
| parent | 785c8ab4276110f0aa8d53d704dff04c4d1996f1 (diff) | |
| download | golang-78c64cbc52cebee45bc44ab09f172571514fc83f.tar.gz | |
gc: recursive type error
Fixes issue 245.
R=ken2
http://codereview.appspot.com/164094
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/gc/align.c | 3 | ||||
| -rw-r--r-- | src/cmd/gc/typecheck.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/gc/align.c b/src/cmd/gc/align.c index b74ac0f29..cf0851646 100644 --- a/src/cmd/gc/align.c +++ b/src/cmd/gc/align.c @@ -205,6 +205,9 @@ dowidth(Type *t) checkwidth(t->down); break; case TFORW: // should have been filled in + yyerror("invalid recursive type %T", t); + w = 1; // anything will do + break; case TANY: // dummy type; should be replaced before use. if(!debug['A']) diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c index 0fd359b31..76147e48f 100644 --- a/src/cmd/gc/typecheck.c +++ b/src/cmd/gc/typecheck.c @@ -1039,6 +1039,8 @@ reswitch: case ODCLTYPE: ok |= Etop; typecheck(&n->left, Etype); + if(!incannedimport) + checkwidth(n->left->type); goto ret; } |
