mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
21 lines
517 B
Diff
21 lines
517 B
Diff
--- src/lapi.c (old)
|
|
+++ src/lapi.c (new)
|
|
@@ -93,15 +93,14 @@
|
|
|
|
|
|
LUA_API int lua_checkstack (lua_State *L, int size) {
|
|
- int res;
|
|
+ int res = 1;
|
|
lua_lock(L);
|
|
- if ((L->top - L->base + size) > LUAI_MAXCSTACK)
|
|
+ if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)
|
|
res = 0; /* stack overflow */
|
|
- else {
|
|
+ else if (size > 0) {
|
|
luaD_checkstack(L, size);
|
|
if (L->ci->top < L->top + size)
|
|
L->ci->top = L->top + size;
|
|
- res = 1;
|
|
}
|
|
lua_unlock(L);
|
|
return res;
|