aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ltm.c b/ltm.c
index cbc4cc5e..2de75a31 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 2.42 2017/06/29 15:06:44 roberto Exp roberto $ 2** $Id: ltm.c,v 2.43 2017/07/27 13:50: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*/
@@ -167,6 +167,18 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
167} 167}
168 168
169 169
170void luaT_trybiniTM (lua_State *L, const TValue *p1, int i2,
171 int inv, StkId res, TMS event) {
172 TValue aux; TValue *p2;
173 setivalue(&aux, i2);
174 if (inv) { /* arguments were exchanged? */
175 p2 = p1; p1 = &aux; /* correct them */
176 }
177 else p2 = &aux;
178 luaT_trybinTM(L, p1, p2, res, event);
179}
180
181
170int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, 182int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2,
171 TMS event) { 183 TMS event) {
172 if (!callbinTM(L, p1, p2, L->top, event)) 184 if (!callbinTM(L, p1, p2, L->top, event))