summaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-02-18 11:52:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-02-18 11:52:03 -0300
commit2b579b4b83f7ebc527089fcb5f18b8531858609c (patch)
tree578db4723a03a9eb0a66b441563a6af1c0d03d06 /ldo.c
parenta1d0e1a11adf5fac8f30cc3cf1da6162174a5ce9 (diff)
downloadlua-2b579b4b83f7ebc527089fcb5f18b8531858609c.tar.gz
lua-2b579b4b83f7ebc527089fcb5f18b8531858609c.tar.bz2
lua-2b579b4b83f7ebc527089fcb5f18b8531858609c.zip
panic mode does not reset stack (so that panic function can gather
debug information from it)
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/ldo.c b/ldo.c
index f2f3f207..e431e130 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.50 2008/10/30 15:39:30 roberto Exp roberto $ 2** $Id: ldo.c,v 2.51 2008/11/06 12:43:51 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*/
@@ -78,18 +78,6 @@ static void restore_stack_limit (lua_State *L) {
78} 78}
79 79
80 80
81static void resetstack (lua_State *L, int status) {
82 L->ci = L->base_ci;
83 L->base = L->ci->base;
84 luaF_close(L, L->base); /* close possible pending closures */
85 luaD_seterrorobj(L, status, L->base);
86 L->allowhook = 1;
87 restore_stack_limit(L);
88 L->errfunc = 0;
89 L->errorJmp = NULL;
90}
91
92
93void luaD_throw (lua_State *L, int errcode) { 81void luaD_throw (lua_State *L, int errcode) {
94 if (L->errorJmp) { 82 if (L->errorJmp) {
95 L->errorJmp->status = errcode; 83 L->errorJmp->status = errcode;
@@ -98,7 +86,6 @@ void luaD_throw (lua_State *L, int errcode) {
98 else { 86 else {
99 L->status = cast_byte(errcode); 87 L->status = cast_byte(errcode);
100 if (G(L)->panic) { 88 if (G(L)->panic) {
101 resetstack(L, errcode);
102 lua_unlock(L); 89 lua_unlock(L);
103 G(L)->panic(L); 90 G(L)->panic(L);
104 } 91 }