aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index 7b7466d6..714fac6a 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 1.87 2002/03/11 12:45:00 roberto Exp roberto $ 2** $Id: lstate.c,v 1.88 2002/03/20 12:52:32 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -25,6 +25,16 @@
25static void close_state (lua_State *L); 25static void close_state (lua_State *L);
26 26
27 27
28/*
29** you can change this function through the official API
30** call `lua_setpanicf'
31*/
32static int default_panic (lua_State *L) {
33 fprintf(stderr, "unable to recover; exiting\n");
34 return 0;
35}
36
37
28static void stack_init (lua_State *L, lua_State *OL) { 38static void stack_init (lua_State *L, lua_State *OL) {
29 L->stack = luaM_newvector(OL, BASIC_STACK_SIZE, TObject); 39 L->stack = luaM_newvector(OL, BASIC_STACK_SIZE, TObject);
30 L->stacksize = BASIC_STACK_SIZE; 40 L->stacksize = BASIC_STACK_SIZE;
@@ -52,6 +62,7 @@ static void f_luaopen (lua_State *L, void *ud) {
52 G(L)->strt.hash = NULL; 62 G(L)->strt.hash = NULL;
53 G(L)->Mbuffer = NULL; 63 G(L)->Mbuffer = NULL;
54 G(L)->Mbuffsize = 0; 64 G(L)->Mbuffsize = 0;
65 G(L)->panic = &default_panic;
55 G(L)->rootproto = NULL; 66 G(L)->rootproto = NULL;
56 G(L)->rootcl = NULL; 67 G(L)->rootcl = NULL;
57 G(L)->roottable = NULL; 68 G(L)->roottable = NULL;