Commit 4589c345 authored by Russ Cox's avatar Russ Cox

gc: fix this morning's bug fix

R=ken2
CC=golang-dev
https://golang.org/cl/216043
parent fc010adc
......@@ -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]
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment