diff options
Diffstat (limited to 'lib/lua')
-rw-r--r-- | lib/lua/src/lapi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/lua/src/lapi.c b/lib/lua/src/lapi.c index 32421e3..c2c898d 100644 --- a/lib/lua/src/lapi.c +++ b/lib/lua/src/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.8 2008-02-18 10:15:45 pixel Exp $ +** $Id: lapi.c,v 1.9 2008-07-02 16:35:51 pixel Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -93,14 +93,15 @@ void luaA_pushobject (lua_State *L, const TValue *o) { LUA_API int lua_checkstack (lua_State *L, int size) { - int res = 1; + int res; lua_lock(L); - if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) + if ((L->top - L->base + size) > LUAI_MAXCSTACK) res = 0; /* stack overflow */ - else if (size > 0) { + else { luaD_checkstack(L, size); if (L->ci->top < L->top + size) L->ci->top = L->top + size; + res = 1; } lua_unlock(L); return res; |