summaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ltm.c b/ltm.c
index ce4fd89a..14dbe772 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 1.54 2000/10/05 13:00:17 roberto Exp roberto $ 2** $Id: ltm.c,v 1.55 2000/10/20 16:39:03 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*/
@@ -141,7 +141,6 @@ LUA_API void lua_gettagmethod (lua_State *L, int t, const char *event) {
141 141
142 142
143LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) { 143LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) {
144 Closure *oldtm;
145 int e = luaI_checkevent(L, event, t); 144 int e = luaI_checkevent(L, event, t);
146 checktag(L, t); 145 checktag(L, t);
147 if (!luaT_validevent(t, e)) 146 if (!luaT_validevent(t, e))
@@ -149,7 +148,6 @@ LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) {
149 luaT_eventname[e], luaO_typenames[t], 148 luaT_eventname[e], luaO_typenames[t],
150 (t == LUA_TTABLE || t == LUA_TUSERDATA) ? 149 (t == LUA_TTABLE || t == LUA_TUSERDATA) ?
151 " with default tag" : ""); 150 " with default tag" : "");
152 oldtm = luaT_gettm(L, t, e);
153 switch (ttype(L->top - 1)) { 151 switch (ttype(L->top - 1)) {
154 case LUA_TNIL: 152 case LUA_TNIL:
155 luaT_gettm(L, t, e) = NULL; 153 luaT_gettm(L, t, e) = NULL;
@@ -160,7 +158,6 @@ LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) {
160 default: 158 default:
161 lua_error(L, "tag method must be a function (or nil)"); 159 lua_error(L, "tag method must be a function (or nil)");
162 } 160 }
163 clvalue(L->top - 1) = oldtm; 161 L->top--;
164 ttype(L->top - 1) = (oldtm ? LUA_TFUNCTION : LUA_TNIL);
165} 162}
166 163