summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2021-07-21 12:14:09 +0200
committerMike Pall <mike>2021-07-21 12:14:09 +0200
commit81a797373fa5364f7640b7f1668abada56a45d6b (patch)
tree1f41a9b2621db18577c0aeafe4e5c28b9e5e26eb
parent6ca580155b035fd369f193cdee59391b594a5028 (diff)
downloadluajit2-81a797373fa5364f7640b7f1668abada56a45d6b.tar.gz
Fix minilua vararg stack handling.
Note: this is not exploitable! minilua is only used during the LuaJIT build process. It only runs controlled and static Lua code (DynASM), which is entirely contained within this repo. LuaJIT itself has completely different stack handling code and is not affected either. This change is solely for the benefit of others, who might possibly use minilua for purposes other than running DynASM.
-rw-r--r--src/host/minilua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/minilua.c b/src/host/minilua.c
index 79150286..cfc7491d 100644
--- a/src/host/minilua.c
+++ b/src/host/minilua.c
@@ -1134,7 +1134,7 @@ if(!cl->isC){
CallInfo*ci;
StkId st,base;
Proto*p=cl->p;
-luaD_checkstack(L,p->maxstacksize);
+luaD_checkstack(L,p->maxstacksize+p->numparams);
func=restorestack(L,funcr);
if(!p->is_vararg){
base=func+1;