From d4ad8e8ce35b330904e327a586606d95bb87d143 Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Tue, 9 Feb 2010 17:26:04 -0800 Subject: [PATCH] bug fix in 6c/8c/5c mis-aligned function arguments. R=rsc CC=golang-dev https://golang.org/cl/206054 --- src/cmd/cc/com.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/cmd/cc/com.c b/src/cmd/cc/com.c index af2509c5fd0..5cbe8b77cd2 100644 --- a/src/cmd/cc/com.c +++ b/src/cmd/cc/com.c @@ -801,7 +801,19 @@ tcoma(Node *l, Node *n, Type *t, int f) n->type, t, l); return 1; } - switch(t->etype) { +// switch(t->etype) { +// case TCHAR: +// case TSHORT: +// t = types[TINT]; +// break; +// +// case TUCHAR: +// case TUSHORT: +// t = types[TUINT]; +// break; +// } + } else { + switch(n->type->etype) { case TCHAR: case TSHORT: t = types[TINT]; @@ -811,23 +823,12 @@ tcoma(Node *l, Node *n, Type *t, int f) case TUSHORT: t = types[TUINT]; break; + + case TFLOAT: + t = types[TDOUBLE]; } - } else - switch(n->type->etype) - { - case TCHAR: - case TSHORT: - t = types[TINT]; - break; - - case TUCHAR: - case TUSHORT: - t = types[TUINT]; - break; - - case TFLOAT: - t = types[TDOUBLE]; } + if(t != T && !sametype(t, n->type)) { n1 = new1(OXXX, Z, Z); *n1 = *n;