aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ltm.c b/ltm.c
index 524b4fb2..b009e8b4 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 1.50 2000/09/29 12:42:13 roberto Exp roberto $ 2** $Id: ltm.c,v 1.51 2000/10/02 20:10:55 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -117,15 +117,20 @@ int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) {
117} 117}
118 118
119 119
120int luaT_effectivetag (lua_State *L, const TObject *o) { 120const TObject *luaT_gettagmethods (lua_State *L, const TObject *o) {
121 lua_Tag t = ttype(o); 121 lua_Tag t = ttype(o);
122 switch (t) { 122 switch (t) {
123 case TAG_USERDATA: { 123 case TAG_USERDATA: {
124 int tag = tsvalue(o)->u.d.tag; 124 int tag = tsvalue(o)->u.d.tag;
125 return (tag > L->last_tag) ? TAG_USERDATA : tag; /* deprecated test */ 125 if (tag > L->last_tag)
126 return L->IMtable[TAG_USERDATA].int_method;
127 else
128 return L->IMtable[tag].int_method;
126 } 129 }
127 case TAG_TABLE: return hvalue(o)->htag; 130 case TAG_TABLE:
128 default: return t; 131 return L->IMtable[hvalue(o)->htag].int_method;
132 default:
133 return L->IMtable[(int)t].int_method;;
129 } 134 }
130} 135}
131 136