summaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-04 15:51:04 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-04 15:51:04 -0200
commit4343420d4d559a7d4cdacdbc1fd61552dcf59f04 (patch)
tree57e0bdd41e2f3a4ab70d3150022569751e3d02ad /ltm.c
parent1f7103e05d01a6a4c300a73bcfc8d9b17b2c20a4 (diff)
downloadlua-github-4343420d4d559a7d4cdacdbc1fd61552dcf59f04.tar.gz
simplified version of `gc' tag method (only for userdata now).
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c8
1 files changed, 6 insertions, 2 deletions
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];
}