aboutsummaryrefslogtreecommitdiff
path: root/c-api/compat-5.3.c
diff options
context:
space:
mode:
Diffstat (limited to 'c-api/compat-5.3.c')
-rw-r--r--c-api/compat-5.3.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c
index 34b8001..fd41798 100644
--- a/c-api/compat-5.3.c
+++ b/c-api/compat-5.3.c
@@ -155,6 +155,18 @@ COMPAT53_API void luaL_checkversion (lua_State *L) {
155} 155}
156 156
157 157
158COMPAT53_API void luaL_checkstack (lua_State *L, int sp, const char *msg) {
159 if (!lua_checkstack(L, sp+LUA_MINSTACK)) {
160 if (msg != NULL)
161 luaL_error(L, "stack overflow (%s)", msg);
162 else {
163 lua_pushliteral(L, "stack overflow");
164 lua_error(L);
165 }
166 }
167}
168
169
158COMPAT53_API int luaL_getsubtable (lua_State *L, int i, const char *name) { 170COMPAT53_API int luaL_getsubtable (lua_State *L, int i, const char *name) {
159 int abs_i = lua_absindex(L, i); 171 int abs_i = lua_absindex(L, i);
160 luaL_checkstack(L, 3, "not enough stack slots"); 172 luaL_checkstack(L, 3, "not enough stack slots");