diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-02-18 11:52:03 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-02-18 11:52:03 -0300 |
| commit | 2b579b4b83f7ebc527089fcb5f18b8531858609c (patch) | |
| tree | 578db4723a03a9eb0a66b441563a6af1c0d03d06 | |
| parent | a1d0e1a11adf5fac8f30cc3cf1da6162174a5ce9 (diff) | |
| download | lua-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)
| -rw-r--r-- | ldo.c | 15 |
1 files changed, 1 insertions, 14 deletions
| @@ -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 | ||
| 81 | static 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 | |||
| 93 | void luaD_throw (lua_State *L, int errcode) { | 81 | void 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 | } |
