From a81870badf2b625dd82c705796d2e897b53749bc Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 8 Feb 2009 11:19:45 -0800 Subject: [PATCH] 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 --- src/cmd/gc/walk.c | 5 +++++ 1 file changed, 5 insertions(+) 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)); -- 2.48.1