Răsfoiți Sursa

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

Mike Pall 14 ani în urmă
părinte
comite
4c50e36cee
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      src/lj_state.h

+ 2 - 2
src/lj_state.h

@@ -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)
 {
-  if ((MSize)(mref(L->maxstack, char) - (char *)L->top) <=
-      need*(MSize)sizeof(TValue))
+  if ((mref(L->maxstack, char) - (char *)L->top) <=
+      need*(ptrdiff_t)sizeof(TValue))
     lj_state_growstack(L, need);
 }