blob: cce73ff96bdc36ee76246278faeb8e49b7a177da [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: Enrico Tassi <gareuselesinge@debian.org>
2Date: Tue, 26 Aug 2014 16:20:55 +0200
3Subject: Fix stack overflow in vararg functions
4
5---
6 src/ldo.c | 2 +-
7 1 file changed, 1 insertion(+), 1 deletion(-)
8
9--- a/src/ldo.c
10+++ b/src/ldo.c
11@@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId fu
12 CallInfo *ci;
13 StkId st, base;
14 Proto *p = cl->p;
15- luaD_checkstack(L, p->maxstacksize);
16+ luaD_checkstack(L, p->maxstacksize + p->numparams);
17 func = restorestack(L, funcr);
18 if (!p->is_vararg) { /* no varargs? */
19 base = func + 1;