From 86431a2f1c668844c665f9d09e246de906b511d8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 13 Dec 2017 16:32:09 -0200 Subject: new opcodes BANDK/BORK/BXORK. (They do not use immediate operands because, too often, masks in bitwise operations are integers larger than one byte.) --- ltm.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index fe87553d..d30bef2f 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.50 2017/11/27 17:44:31 roberto Exp roberto $ +** $Id: ltm.c,v 2.51 2017/11/30 15:37:16 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -166,15 +166,20 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, } +void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, int inv, TMS event) { + if (inv) + luaT_trybinTM(L, p2, p1, res, event); + else + luaT_trybinTM(L, p1, p2, res, event); +} + + void luaT_trybiniTM (lua_State *L, const TValue *p1, int i2, int inv, StkId res, TMS event) { - TValue aux; const TValue *p2; + TValue aux; setivalue(&aux, i2); - if (inv) { /* arguments were exchanged? */ - p2 = p1; p1 = &aux; /* correct them */ - } - else p2 = &aux; - luaT_trybinTM(L, p1, p2, res, event); + luaT_trybinassocTM(L, p1, &aux, res, inv, event); } -- cgit v1.2.3-55-g6feb