From: Russ Cox Date: Sun, 8 Feb 2009 19:19:45 +0000 (-0800) Subject: add error to catch 6g alignment bug. X-Git-Tag: weekly.2009-11-06~2204 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a81870badf2b625dd82c705796d2e897b53749bc;p=gostls13.git add error to catch 6g alignment bug. 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 --- diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 87e4fae475..bd2fb74f74 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -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));