From 093c16b67b263e334600ed306310b9015f65fa8b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 27 Nov 2017 15:44:31 -0200 Subject: new opcodes 'OP_LTI' and 'OP_LEI' --- ltm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index 873c2be4..5ee123f5 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.48 2017/11/08 14:50:23 roberto Exp $ +** $Id: ltm.c,v 2.49 2017/11/23 19:18:10 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -196,6 +196,20 @@ int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, } +int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, + int inv, TMS event) { + TValue aux; const TValue *p2; + setivalue(&aux, v2); + if (inv) { /* arguments were exchanged? */ + p2 = p1; p1 = &aux; /* correct them */ + event = (event == TM_LE) ? TM_LT : TM_LE; + } + else + p2 = &aux; + return (luaT_callorderTM(L, p1, p2, event) != inv); +} + + void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) { int i; Table *vtab; -- cgit v1.2.3-55-g6feb