aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-05 16:41:24 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-05 16:41:24 -0300
commit943b8f5b1801c72fee8bf1050919cf1acb600555 (patch)
tree6bef02079082422a78a933230619867bbb2e00e7 /ldo.c
parent762d059a13d83eb367238a6115bbb4f5f13fcb49 (diff)
downloadlua-943b8f5b1801c72fee8bf1050919cf1acb600555.tar.gz
lua-943b8f5b1801c72fee8bf1050919cf1acb600555.tar.bz2
lua-943b8f5b1801c72fee8bf1050919cf1acb600555.zip
details
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/ldo.c b/ldo.c
index b2043b2b..cbaca68c 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.133 2001/04/06 19:26:06 roberto Exp roberto $ 2** $Id: ldo.c,v 1.134 2001/04/11 18:39:37 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -48,17 +48,15 @@ void luaD_init (lua_State *L, int stacksize) {
48} 48}
49 49
50 50
51void luaD_checkstack (lua_State *L, int n) { 51void luaD_stackerror (lua_State *L) {
52 if (L->stack_last - L->top <= n) { /* stack overflow? */ 52 if (L->stack_last == L->stack+L->stacksize-1) {
53 if (L->stack_last == L->stack+L->stacksize-1) { 53 /* overflow while handling overflow */
54 /* overflow while handling overflow */ 54 luaD_breakrun(L, LUA_ERRERR); /* break run without error message */
55 luaD_breakrun(L, LUA_ERRERR); /* break run without error message */ 55 }
56 } 56 else {
57 else { 57 L->stack_last += EXTRA_STACK; /* to be used by error message */
58 L->stack_last += EXTRA_STACK; /* to be used by error message */ 58 lua_assert(L->stack_last == L->stack+L->stacksize-1);
59 lua_assert(L->stack_last == L->stack+L->stacksize-1); 59 luaD_error(L, l_s("stack overflow"));
60 luaD_error(L, l_s("stack overflow"));
61 }
62 } 60 }
63} 61}
64 62