]> Cypherpunks repositories - gostls13.git/commitdiff
maps have == so maps are okay as map keys.
authorRuss Cox <rsc@golang.org>
Fri, 3 Jul 2009 16:44:59 +0000 (09:44 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 3 Jul 2009 16:44:59 +0000 (09:44 -0700)
alignment issue is fixed.

R=ken
OCL=31124
CL=31144

src/cmd/gc/subr.c
src/cmd/gc/walk.c

index 2e0c6b07da82ff7c922f12a719e48276c9f68225..3ceaa4e964d9e90b6c5c6b1e88da8e08523df816 100644 (file)
@@ -327,7 +327,7 @@ algtype(Type *t)
 {
        int a;
 
-       if(issimple[t->etype] || isptr[t->etype] || t->etype == TCHAN || t->etype == TFUNC)
+       if(issimple[t->etype] || isptr[t->etype] || t->etype == TCHAN || t->etype == TFUNC || t->etype == TMAP)
                a = AMEM;       // just bytes (int, ptr, etc)
        else if(t->etype == TSTRING)
                a = ASTRING;    // string
index 50e333797f949100d901055b74f745175adb98e8..6d102982cb9f87334877d47ded106285e5c893fe 100644 (file)
@@ -610,7 +610,7 @@ loop:
                        goto nottop;
                walkconv(n);
                goto ret;
-       
+
        case OCONVNOP:
                goto ret;
 
@@ -2111,13 +2111,11 @@ ascompatte(int op, Type **nl, Node **nr, int fp)
        && structnext(&peekl) != T
        && listnext(&peekr) == N
        && eqtypenoname(r->type, *nl)) {
-               // TODO(rsc): clumsy check for differently aligned structs.
-               // need to handle eventually, but this keeps us
-               // from inserting bugs
-               if(r->type->width != (*nl)->width) {
-                       fprint(2, "oops: %T %d %T %d\n", r->type, r->type->width, (*nl), (*nl)->width);
-                       yyerror("misaligned multiple return (6g's fault)");
-               }
+               // clumsy check for differently aligned structs.
+               // now that output structs are aligned separately
+               // from the input structs, should never happen.
+               if(r->type->width != (*nl)->width)
+                       fatal("misaligned multiple return\n\t%T\n\t%T", r->type, *nl);
                a = nodarg(*nl, fp);
                a->type = r->type;
                return convas(nod(OAS, a, r));