diff options
author | pixel <pixel> | 2008-07-02 16:35:51 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-07-02 16:35:51 +0000 |
commit | 7bb6385ee34141771aac6e3e6e348c213d92f451 (patch) | |
tree | 207c994d376d68dee9fa34fbfa3e0f1b17cca0b2 /lib/lua/src | |
parent | 01ee09afd9e367a52a02b5ff29cf8d11fabd82ec (diff) |
Fixing code for the latests mingw32 compilers.
Diffstat (limited to 'lib/lua/src')
-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; |