LJ_FR2: Fix stack checks in vararg calls.
Thanks to Peter Cawley. #1048
This commit is contained in:
@@ -453,7 +453,7 @@ static int call_init(lua_State *L, GCfunc *fn)
|
||||
int numparams = pt->numparams;
|
||||
int gotparams = (int)(L->top - L->base);
|
||||
int need = pt->framesize;
|
||||
if ((pt->flags & PROTO_VARARG)) need += 1+gotparams;
|
||||
if ((pt->flags & PROTO_VARARG)) need += 1+LJ_FR2+gotparams;
|
||||
lj_state_checkstack(L, (MSize)need);
|
||||
numparams -= gotparams;
|
||||
return numparams >= 0 ? numparams : 0;
|
||||
|
||||
Reference in New Issue
Block a user