]> Cypherpunks repositories - gostls13.git/commitdiff
add error to catch 6g alignment bug.
authorRuss Cox <rsc@golang.org>
Sun, 8 Feb 2009 19:19:45 +0000 (11:19 -0800)
committerRuss Cox <rsc@golang.org>
Sun, 8 Feb 2009 19:19:45 +0000 (11:19 -0800)
the fix appears to be to align the
out struct on an 8 boundary, but that
is a bit involved.

R=ken
OCL=24657
CL=24657

src/cmd/gc/walk.c

index 87e4fae4754cc9de9e9f64e2c3c308890dac4476..bd2fb74f74661d68ffedc037aa29cabaa790f883 100644 (file)
@@ -1906,6 +1906,11 @@ ascompatte(int op, Type **nl, Node **nr, int fp)
        && structnext(&peekl) != T
        && listnext(&peekr) == N
        && eqtypenoname(r->type, *nl)) {
+               // clumsy check for differently aligned structs.
+               // need to handle eventually, but this keeps us
+               // from inserting bugs
+               if(r->type->width != (*nl)->width)
+                       yyerror("misaligned multiple return (6g's fault)");
                a = nodarg(*nl, fp);
                a->type = r->type;
                return convas(nod(OAS, a, r));