From 522407e23ae02cdfcb221f1fea96c6c44aae0200 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 16 Jul 2003 17:51:47 -0300 Subject: [PATCH] we do not need a default panic (that does nothing anyway...) --- ldo.c | 4 ++-- lstate.c | 13 ++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ldo.c b/ldo.c index f462353f..25c4a27a 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 1.219 2003/05/14 21:02:39 roberto Exp roberto $ +** $Id: ldo.c,v 1.220 2003/07/16 20:49:02 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -87,7 +87,7 @@ void luaD_throw (lua_State *L, int errcode) { L_THROW(L->errorJmp); } else { - G(L)->panic(L); + if (G(L)->panic) G(L)->panic(L); exit(EXIT_FAILURE); } } diff --git a/lstate.c b/lstate.c index 2153d3d9..6bed2e7c 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 1.123 2003/04/03 13:35:34 roberto Exp $ +** $Id: lstate.c,v 1.124 2003/07/16 20:49:02 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -35,15 +35,6 @@ union UEXTRASPACE {L_Umaxalign a; LUA_USERSTATE b;}; -/* -** you can change this function through the official API: -** call `lua_setpanicf' -*/ -static int default_panic (lua_State *L) { - UNUSED(L); - return 0; -} - static lua_State *mallocstate (lua_State *L) { lu_byte *block = (lu_byte *)luaM_malloc(L, sizeof(lua_State) + EXTRASPACE); @@ -99,7 +90,7 @@ static void f_luaopen (lua_State *L, void *ud) { setnilvalue(defaultmeta(L)); setnilvalue(registry(L)); luaZ_initbuffer(L, &g->buff); - g->panic = default_panic; + g->panic = NULL; g->rootgc = NULL; g->rootudata = NULL; g->tmudata = NULL;