aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-02-18 18:31:13 -0800
committerRuss Cox <rsc@golang.org>2010-02-18 18:31:13 -0800
commit4589c3458033d8797c34dedc5f72f534487d2cd6 (patch)
treec432bc45f52fb21cd9de84385007f22f552e0dee
parentfc010adcd7005f6eaf646b6edde50d09cac69fc1 (diff)
downloadgo-4589c3458033d8797c34dedc5f72f534487d2cd6.tar.gz
go-4589c3458033d8797c34dedc5f72f534487d2cd6.zip
gc: fix this morning's bug fix
R=ken2 CC=golang-dev https://golang.org/cl/216043
-rw-r--r--src/cmd/8g/ggen.c2
-rw-r--r--src/cmd/gc/align.c2
-rw-r--r--src/cmd/gc/dcl.c3
-rw-r--r--src/cmd/gc/typecheck.c2
-rw-r--r--src/cmd/gc/walk.c3
5 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/8g/ggen.c b/src/cmd/8g/ggen.c
index 63a6b6f622..549488d16c 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 095645955b..278540a249 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 5359d7252d..ecd72a56bc 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 9804220d1d..2908459fc4 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 e28cf288fc..5113094304 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;