mirror of
https://github.com/lua/lua
synced 2024-12-24 03:16:50 +03:00
we do not need a default panic (that does nothing anyway...)
This commit is contained in:
parent
fa26d294ae
commit
522407e23a
4
ldo.c
4
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);
|
||||
}
|
||||
}
|
||||
|
13
lstate.c
13
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;
|
||||
|
Loading…
Reference in New Issue
Block a user