aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/ltm.c b/ltm.c
index fe87553d..d30bef2f 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 2.50 2017/11/27 17:44:31 roberto Exp roberto $ 2** $Id: ltm.c,v 2.51 2017/11/30 15:37:16 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*/
@@ -166,15 +166,20 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
166} 166}
167 167
168 168
169void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2,
170 StkId res, int inv, TMS event) {
171 if (inv)
172 luaT_trybinTM(L, p2, p1, res, event);
173 else
174 luaT_trybinTM(L, p1, p2, res, event);
175}
176
177
169void luaT_trybiniTM (lua_State *L, const TValue *p1, int i2, 178void luaT_trybiniTM (lua_State *L, const TValue *p1, int i2,
170 int inv, StkId res, TMS event) { 179 int inv, StkId res, TMS event) {
171 TValue aux; const TValue *p2; 180 TValue aux;
172 setivalue(&aux, i2); 181 setivalue(&aux, i2);
173 if (inv) { /* arguments were exchanged? */ 182 luaT_trybinassocTM(L, p1, &aux, res, inv, event);
174 p2 = p1; p1 = &aux; /* correct them */
175 }
176 else p2 = &aux;
177 luaT_trybinTM(L, p1, p2, res, event);
178} 183}
179 184
180 185