Pārlūkot izejas kodu

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.
Mike Pall 4 gadi atpakaļ
vecāks
revīzija
81a797373f
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/host/minilua.c

+ 1 - 1
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;