From 4343420d4d559a7d4cdacdbc1fd61552dcf59f04 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 4 Oct 1999 15:51:04 -0200 Subject: simplified version of `gc' tag method (only for userdata now). --- ltm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index f5da877f..37ef9fef 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 1.26 1999/08/16 20:52:00 roberto Exp roberto $ +** $Id: ltm.c,v 1.27 1999/09/20 14:57:29 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -39,13 +39,17 @@ static const char luaT_validevents[NUM_TAGS][IM_N] = { {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* LUA_T_USERDATA */ {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, /* LUA_T_NUMBER */ {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, /* LUA_T_STRING */ -{0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* LUA_T_ARRAY */ +{0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* LUA_T_ARRAY */ {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* LUA_T_PROTO */ {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* LUA_T_CPROTO */ {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} /* LUA_T_NIL */ }; int luaT_validevent (int t, int e) { /* ORDER LUA_T */ +#ifdef LUA_COMPAT_GC + if (t == LUA_T_ARRAY && e == IM_GC) + return 1; /* old versions allowed gc tag method for tables */ +#endif return (t < LUA_T_NIL) ? 1 : luaT_validevents[-t][e]; } -- cgit v1.2.3-55-g6feb