1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:14:40 -07:00

gc: fix this morning's bug fix

R=ken2
CC=golang-dev
https://golang.org/cl/216043
This commit is contained in:
Russ Cox 2010-02-18 18:31:13 -08:00
parent fc010adcd7
commit 4589c34580
5 changed files with 7 additions and 5 deletions

View File

@ -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]

View File

@ -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;
}

View File

@ -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);

View File

@ -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) {

View File

@ -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;