From dba17070ac2a6a54079b0b935635377545a3b764 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 17 Jun 2004 11:06:52 -0300 Subject: optional error for accesss to undefined variables/fields --- lstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index db4efa03..f8f3f148 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.7 2004/05/31 18:51:50 roberto Exp roberto $ +** $Id: lstate.c,v 2.8 2004/06/02 19:09:36 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -87,6 +87,7 @@ static void f_luaopen (lua_State *L, void *ud) { setbit(L->marked, FIXEDBIT); stack_init(L, L); /* init stack */ sethvalue(L, gt(L), luaH_new(L, 0, 4)); /* table of globals */ + hvalue(gt(L))->metatable = luaH_new(L, 0, 0); /* globals metatable */ sethvalue(L, registry(L), luaH_new(L, 4, 4)); /* registry */ luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ luaT_init(L); -- cgit v1.2.3-55-g6feb