diff options
-rw-r--r-- | lapi.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.200 2014/02/26 12:39:30 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.201 2014/03/12 20:57:40 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 | */ |
@@ -94,6 +94,7 @@ LUA_API int lua_checkstack (lua_State *L, int size) { | |||
94 | int res; | 94 | int res; |
95 | CallInfo *ci = L->ci; | 95 | CallInfo *ci = L->ci; |
96 | lua_lock(L); | 96 | lua_lock(L); |
97 | api_check(L, size >= 0, "negative 'size'"); | ||
97 | if (L->stack_last - L->top > size) /* stack large enough? */ | 98 | if (L->stack_last - L->top > size) /* stack large enough? */ |
98 | res = 1; /* yes; check is OK */ | 99 | res = 1; /* yes; check is OK */ |
99 | else { /* no; need to grow stack */ | 100 | else { /* no; need to grow stack */ |