]> Cypherpunks repositories - gostls13.git/commitdiff
gc: fix this morning's bug fix
authorRuss Cox <rsc@golang.org>
Fri, 19 Feb 2010 02:31:13 +0000 (18:31 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2010 02:31:13 +0000 (18:31 -0800)
R=ken2
CC=golang-dev
https://golang.org/cl/216043

src/cmd/8g/ggen.c
src/cmd/gc/align.c
src/cmd/gc/dcl.c
src/cmd/gc/typecheck.c
src/cmd/gc/walk.c

index 63a6b6f62282f63e441d8a88050f672f3f12f3b5..549488d16c9a99f5f52a7aa10833569795c930b0 100644 (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]
 
index 095645955bc2f2fe1dd5431c54cb805e08168872..278540a249a87c4ea3d537a4d994e5f2e9951f68 100644 (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;
        }
index 5359d7252df55334e0e09665cbf9ffa08c405b3f..ecd72a56bcc45caa43c2f4aceca047773adea510 100644 (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);
index 9804220d1d48d9d84c93fdf9ab6ddc4eaadb6b24..2908459fc48e3781a842dffc4e66c0476a521fdd 100644 (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) {
index e28cf288fc1d898d20d786cca440360820fc8b29..5113094304c7cbb7dc997b314b4a7e1ada91fee6 100644 (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;