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]
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;
}
// 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);
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) {
{
Node *nt;
- nt = n->type->nod;
+ nt = n->type->nname;
typecheck(&nt, Etype);
if(nt->type == T) {
// type check failed; leave empty func
t->local = n->local;
t->vargen = n->vargen;
t->siggen = 0;
- t->printed = 0;
t->method = nil;
t->nod = N;
t->printed = 0;