diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-26 17:46:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-26 17:46:10 -0300 |
commit | 81215cd59f58923ae9807d34f1dd46a51f400e4b (patch) | |
tree | 9317d562ae3ea5d54cd5487b220f6e0a20c259a3 /lapi.c | |
parent | 0b9b53e21c30fff06ae39abc00a3c43ab5a18596 (diff) | |
download | lua-81215cd59f58923ae9807d34f1dd46a51f400e4b.tar.gz lua-81215cd59f58923ae9807d34f1dd46a51f400e4b.tar.bz2 lua-81215cd59f58923ae9807d34f1dd46a51f400e4b.zip |
simpler way to control stack overflow
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.178 2002/03/18 20:11:52 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.179 2002/03/20 12:51:29 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -85,7 +85,7 @@ void luaA_pushobject (lua_State *L, const TObject *o) { | |||
85 | LUA_API int lua_checkstack (lua_State *L, int size) { | 85 | LUA_API int lua_checkstack (lua_State *L, int size) { |
86 | int res; | 86 | int res; |
87 | lua_lock(L); | 87 | lua_lock(L); |
88 | if ((L->top - L->stack) >= LUA_MAXSTACK - size) | 88 | if ((L->top - L->ci->base + size) > LUA_MAXCSTACK) |
89 | res = 0; /* stack overflow */ | 89 | res = 0; /* stack overflow */ |
90 | else { | 90 | else { |
91 | luaD_checkstack(L, size); | 91 | luaD_checkstack(L, size); |