You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-lang/lua/files/5.1.3/06_all_c_stack.upstream.patch

22 lines
687 B

diff -rdu lua-5.1.3.orig/src/lundump.c lua-5.1.3/src/lundump.c
--- lua-5.1.3.orig/src/lundump.c 2008-02-12 16:17:59.000000000 +0000
+++ lua-5.1.3/src/lundump.c 2008-02-12 16:26:32.000000000 +0000
@@ -161,7 +160,9 @@
static Proto* LoadFunction(LoadState* S, TString* p)
{
- Proto* f=luaF_newproto(S->L);
+ Proto* f;
+ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
+ f=luaF_newproto(S->L);
setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
f->source=LoadString(S); if (f->source==NULL) f->source=p;
f->linedefined=LoadInt(S);
@@ -175,6 +176,7 @@
LoadDebug(S,f);
IF (!luaG_checkcode(f), "bad code");
S->L->top--;
+ S->L->nCcalls--;
return f;
}