summaryrefslogtreecommitdiff
path: root/src/cmd/5c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-04 15:34:25 -0800
committerRuss Cox <rsc@golang.org>2010-03-04 15:34:25 -0800
commitced760b64147d6c9e41619dd1c51626ff770d9ad (patch)
tree727ed97d2f2b8ca6628785f51b8bd79220ceeb8d /src/cmd/5c
parentfbed511d5c2a061457f2a652ce75baba05bd035e (diff)
downloadgolang-ced760b64147d6c9e41619dd1c51626ff770d9ad.tar.gz
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
Diffstat (limited to 'src/cmd/5c')
-rw-r--r--src/cmd/5c/sgen.c10
1 files changed, 9 insertions, 1 deletions
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;
}