aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-13 16:32:09 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-13 16:32:09 -0200
commit86431a2f1c668844c665f9d09e246de906b511d8 (patch)
tree643d503667b624d4faeecd6bed6cc51f9084cb00 /ltm.c
parent36cf8f3a3c44da00cc9255797153df3c02895379 (diff)
downloadlua-86431a2f1c668844c665f9d09e246de906b511d8.tar.gz
lua-86431a2f1c668844c665f9d09e246de906b511d8.tar.bz2
lua-86431a2f1c668844c665f9d09e246de906b511d8.zip
new opcodes BANDK/BORK/BXORK. (They do not use immediate operands
because, too often, masks in bitwise operations are integers larger than one byte.)
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