Browse Source

we do not need a default panic (that does nothing anyway...)

Roberto Ierusalimschy 22 years ago
parent
commit
522407e23a
2 changed files with 4 additions and 13 deletions
  1. 2 2
      ldo.c
  2. 2 11
      lstate.c

+ 2 - 2
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
 ** Stack and Call structure of Lua
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -87,7 +87,7 @@ void luaD_throw (lua_State *L, int errcode) {
     L_THROW(L->errorJmp);
     L_THROW(L->errorJmp);
   }
   }
   else {
   else {
-    G(L)->panic(L);
+    if (G(L)->panic) G(L)->panic(L);
     exit(EXIT_FAILURE);
     exit(EXIT_FAILURE);
   }
   }
 }
 }

+ 2 - 11
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
 ** Global State
 ** See Copyright Notice in lua.h
 ** 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) {
 static lua_State *mallocstate (lua_State *L) {
   lu_byte *block = (lu_byte *)luaM_malloc(L, sizeof(lua_State) + EXTRASPACE);
   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(defaultmeta(L));
   setnilvalue(registry(L));
   setnilvalue(registry(L));
   luaZ_initbuffer(L, &g->buff);
   luaZ_initbuffer(L, &g->buff);
-  g->panic = default_panic;
+  g->panic = NULL;
   g->rootgc = NULL;
   g->rootgc = NULL;
   g->rootudata = NULL;
   g->rootudata = NULL;
   g->tmudata = NULL;
   g->tmudata = NULL;