summaryrefslogtreecommitdiff
path: root/src/cmd/6c/sgen.c
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/6c/sgen.c
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/6c/sgen.c')
-rw-r--r--src/cmd/6c/sgen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/6c/sgen.c b/src/cmd/6c/sgen.c
index 1a5987f09..b8247a1b7 100644
--- a/src/cmd/6c/sgen.c
+++ b/src/cmd/6c/sgen.c
@@ -34,9 +34,13 @@ Prog*
gtext(Sym *s, int32 stkoff)
{
vlong v;
-
- v = argsize() << 32;
+
+ v = 0;
+ if(!(textflag & NOSPLIT))
+ v |= argsize() << 32;
v |= stkoff & 0xffffffff;
+ if((textflag & NOSPLIT) && stkoff >= 128)
+ yyerror("stack frame too large for NOSPLIT function");
gpseudo(ATEXT, s, nodgconst(v, types[TVLONG]));
return p;