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) ...@@ -220,6 +220,8 @@ cgen_callinter(Node *n, Node *res, int proc)
nodo.xoffset -= widthptr; nodo.xoffset -= widthptr;
cgen(&nodo, &nodr); // REG = 0(REG) -- i.m 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; nodo.xoffset = n->left->xoffset + 3*widthptr + 8;
cgen(&nodo, &nodr); // REG = 32+offset(REG) -- i.m->fun[f] cgen(&nodo, &nodr); // REG = 32+offset(REG) -- i.m->fun[f]
......
...@@ -37,8 +37,6 @@ offmod(Type *t) ...@@ -37,8 +37,6 @@ offmod(Type *t)
for(f=t->type; f!=T; f=f->down) { for(f=t->type; f!=T; f=f->down) {
if(f->etype != TFIELD) if(f->etype != TFIELD)
fatal("widstruct: not TFIELD: %lT", f); fatal("widstruct: not TFIELD: %lT", f);
if(f->type->etype != TFUNC)
continue;
f->width = o; f->width = o;
o += widthptr; o += widthptr;
} }
......
...@@ -814,8 +814,9 @@ stotype(NodeList *l, int et, Type **t) ...@@ -814,8 +814,9 @@ stotype(NodeList *l, int et, Type **t)
// right now all we need is the name list. // right now all we need is the name list.
// avoids cycles for recursive interface types. // avoids cycles for recursive interface types.
n->type = typ(TINTERMETH); n->type = typ(TINTERMETH);
n->type->nod = n->right; n->type->nname = n->right;
n->right = N; n->right = N;
n->left->type = n->type;
queuemethod(n); queuemethod(n);
} else { } else {
typecheck(&n->right, Etype); typecheck(&n->right, Etype);
......
...@@ -1239,6 +1239,8 @@ lookdot(Node *n, Type *t, int dostrcmp) ...@@ -1239,6 +1239,8 @@ lookdot(Node *n, Type *t, int dostrcmp)
if(f2 != T) if(f2 != T)
yyerror("ambiguous DOT reference %S as both field and method", yyerror("ambiguous DOT reference %S as both field and method",
n->right->sym); n->right->sym);
if(f1->width == BADWIDTH)
fatal("lookdot badwidth %T %p", f1, f1);
n->xoffset = f1->width; n->xoffset = f1->width;
n->type = f1->type; n->type = f1->type;
if(t->etype == TINTER) { if(t->etype == TINTER) {
......
...@@ -123,7 +123,7 @@ domethod(Node *n) ...@@ -123,7 +123,7 @@ domethod(Node *n)
{ {
Node *nt; Node *nt;
nt = n->type->nod; nt = n->type->nname;
typecheck(&nt, Etype); typecheck(&nt, Etype);
if(nt->type == T) { if(nt->type == T) {
// type check failed; leave empty func // type check failed; leave empty func
...@@ -164,7 +164,6 @@ walkdeftype(Node *n) ...@@ -164,7 +164,6 @@ walkdeftype(Node *n)
t->local = n->local; t->local = n->local;
t->vargen = n->vargen; t->vargen = n->vargen;
t->siggen = 0; t->siggen = 0;
t->printed = 0;
t->method = nil; t->method = nil;
t->nod = N; t->nod = N;
t->printed = 0; 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