aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-09 17:08:55 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-09 17:08:55 -0200
commiteda87f115632c9c3e234d68b422c12fc7800ab17 (patch)
tree7dffac589c572d693c2b36c42ee19b61bc428d42
parente0e406ead38443ece426cb2ff06d26180855e363 (diff)
downloadlua-eda87f115632c9c3e234d68b422c12fc7800ab17.tar.gz
lua-eda87f115632c9c3e234d68b422c12fc7800ab17.tar.bz2
lua-eda87f115632c9c3e234d68b422c12fc7800ab17.zip
in 'luaL_checkstack', include extra stack space in test to allow
correct execution of error routines, if necessary
-rw-r--r--lauxlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lauxlib.c b/lauxlib.c
index d416097c..34a33504 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.233 2011/06/16 14:11:04 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.234 2011/07/25 17:18:49 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -330,7 +330,9 @@ LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,
330 330
331 331
332LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) { 332LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) {
333 if (!lua_checkstack(L, space)) { 333 /* keep some extra space to run error routines, if needed */
334 const int extra = 2 * LUA_MINSTACK;
335 if (!lua_checkstack(L, space + extra)) {
334 if (msg) 336 if (msg)
335 luaL_error(L, "stack overflow (%s)", msg); 337 luaL_error(L, "stack overflow (%s)", msg);
336 else 338 else