From ced760b64147d6c9e41619dd1c51626ff770d9ad Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 4 Mar 2010 15:34:25 -0800 Subject: cc: disallow ... argument unless NOSPLIT is set. check that NOSPLIT functions don't use too much stack. correct some missing NOSPLITs in the runtime library. Fixes bug reported in https://groups.google.com/group/golang-nuts/t/efff68b73941eccf R=ken2 CC=golang-dev http://codereview.appspot.com/236041 --- src/cmd/5c/sgen.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/cmd/5c') diff --git a/src/cmd/5c/sgen.c b/src/cmd/5c/sgen.c index 1584ecff3..92a0f64f8 100644 --- a/src/cmd/5c/sgen.c +++ b/src/cmd/5c/sgen.c @@ -34,9 +34,17 @@ Prog* gtext(Sym *s, int32 stkoff) { + int32 a; + + a = 0; + if(!(textflag & NOSPLIT)) + a = argsize(); + else if(stkoff >= 128) + yyerror("stack frame too large for NOSPLIT function"); + gpseudo(ATEXT, s, nodconst(stkoff)); p->to.type = D_CONST2; - p->to.offset2 = argsize(); + p->to.offset2 = a; return p; } -- cgit v1.2.3