Fix stack check when L->top is above L->maxstack.

This commit is contained in:
Mike Pall 2011-08-09 15:56:07 +02:00
parent bed0f18466
commit 4c50e36cee

View File

@ -21,8 +21,8 @@ LJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L);
static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need) static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need)
{ {
if ((MSize)(mref(L->maxstack, char) - (char *)L->top) <= if ((mref(L->maxstack, char) - (char *)L->top) <=
need*(MSize)sizeof(TValue)) need*(ptrdiff_t)sizeof(TValue))
lj_state_growstack(L, need); lj_state_growstack(L, need);
} }