diff options
| author | Russ Cox <rsc@golang.org> | 2010-02-18 18:31:13 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-02-18 18:31:13 -0800 |
| commit | 43651f500b2a2d29672328b360e0b5d8c2b4d4f0 (patch) | |
| tree | 1856a37f83fd545707aa8d7a9342369f2425b7f1 | |
| parent | 801d06a1a2e3e5030c3b95f9c83ec3c7e1731d61 (diff) | |
| download | golang-43651f500b2a2d29672328b360e0b5d8c2b4d4f0.tar.gz | |
gc: fix this morning's bug fix
R=ken2
CC=golang-dev
http://codereview.appspot.com/216043
| -rw-r--r-- | src/cmd/8g/ggen.c | 2 | ||||
| -rw-r--r-- | src/cmd/gc/align.c | 2 | ||||
| -rw-r--r-- | src/cmd/gc/dcl.c | 3 | ||||
| -rw-r--r-- | src/cmd/gc/typecheck.c | 2 | ||||
| -rw-r--r-- | src/cmd/gc/walk.c | 3 |
5 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/8g/ggen.c b/src/cmd/8g/ggen.c index 63a6b6f62..549488d16 100644 --- a/src/cmd/8g/ggen.c +++ b/src/cmd/8g/ggen.c @@ -220,6 +220,8 @@ cgen_callinter(Node *n, Node *res, int proc) nodo.xoffset -= widthptr; cgen(&nodo, &nodr); // REG = 0(REG) -- i.m + if(n->left->xoffset == BADWIDTH) + fatal("cgen_callinter: badwidth"); nodo.xoffset = n->left->xoffset + 3*widthptr + 8; cgen(&nodo, &nodr); // REG = 32+offset(REG) -- i.m->fun[f] diff --git a/src/cmd/gc/align.c b/src/cmd/gc/align.c index 095645955..278540a24 100644 --- a/src/cmd/gc/align.c +++ b/src/cmd/gc/align.c @@ -37,8 +37,6 @@ offmod(Type *t) for(f=t->type; f!=T; f=f->down) { if(f->etype != TFIELD) fatal("widstruct: not TFIELD: %lT", f); - if(f->type->etype != TFUNC) - continue; f->width = o; o += widthptr; } diff --git a/src/cmd/gc/dcl.c b/src/cmd/gc/dcl.c index 5359d7252..ecd72a56b 100644 --- a/src/cmd/gc/dcl.c +++ b/src/cmd/gc/dcl.c @@ -814,8 +814,9 @@ stotype(NodeList *l, int et, Type **t) // right now all we need is the name list. // avoids cycles for recursive interface types. n->type = typ(TINTERMETH); - n->type->nod = n->right; + n->type->nname = n->right; n->right = N; + n->left->type = n->type; queuemethod(n); } else { typecheck(&n->right, Etype); diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c index 9804220d1..2908459fc 100644 --- a/src/cmd/gc/typecheck.c +++ b/src/cmd/gc/typecheck.c @@ -1239,6 +1239,8 @@ lookdot(Node *n, Type *t, int dostrcmp) if(f2 != T) yyerror("ambiguous DOT reference %S as both field and method", n->right->sym); + if(f1->width == BADWIDTH) + fatal("lookdot badwidth %T %p", f1, f1); n->xoffset = f1->width; n->type = f1->type; if(t->etype == TINTER) { diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index e28cf288f..511309430 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -123,7 +123,7 @@ domethod(Node *n) { Node *nt; - nt = n->type->nod; + nt = n->type->nname; typecheck(&nt, Etype); if(nt->type == T) { // type check failed; leave empty func @@ -164,7 +164,6 @@ walkdeftype(Node *n) t->local = n->local; t->vargen = n->vargen; t->siggen = 0; - t->printed = 0; t->method = nil; t->nod = N; t->printed = 0; |
