From 2b579b4b83f7ebc527089fcb5f18b8531858609c Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 18 Feb 2009 11:52:03 -0300 Subject: [PATCH] panic mode does not reset stack (so that panic function can gather debug information from it) --- ldo.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/ldo.c b/ldo.c index f2f3f207..e431e130 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.50 2008/10/30 15:39:30 roberto Exp roberto $ +** $Id: ldo.c,v 2.51 2008/11/06 12:43:51 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -78,18 +78,6 @@ static void restore_stack_limit (lua_State *L) { } -static void resetstack (lua_State *L, int status) { - L->ci = L->base_ci; - L->base = L->ci->base; - luaF_close(L, L->base); /* close possible pending closures */ - luaD_seterrorobj(L, status, L->base); - L->allowhook = 1; - restore_stack_limit(L); - L->errfunc = 0; - L->errorJmp = NULL; -} - - void luaD_throw (lua_State *L, int errcode) { if (L->errorJmp) { L->errorJmp->status = errcode; @@ -98,7 +86,6 @@ void luaD_throw (lua_State *L, int errcode) { else { L->status = cast_byte(errcode); if (G(L)->panic) { - resetstack(L, errcode); lua_unlock(L); G(L)->panic(L); }