summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-10 13:50:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-10 13:50:20 -0300
commit1e0ad018cef2a8e771787f126ce2150028749411 (patch)
treeb99b86adaa542e7481252b6525743e45d66d1c67
parent95735bda46278a4bc0966d8a3c9079dd0072c51e (diff)
downloadlua-1e0ad018cef2a8e771787f126ce2150028749411.tar.gz
lua-1e0ad018cef2a8e771787f126ce2150028749411.tar.bz2
lua-1e0ad018cef2a8e771787f126ce2150028749411.zip
Comment about LUA_COMPAT_LT_LE moved to proper place
-rw-r--r--ltm.c9
-rw-r--r--lvm.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/ltm.c b/ltm.c
index 1e32d86a..ca46f04e 100644
--- a/ltm.c
+++ b/ltm.c
@@ -188,6 +188,15 @@ void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2,
188} 188}
189 189
190 190
191/*
192** Calls an order tag method.
193** For lessequal, LUA_COMPAT_LT_LE keeps compatibility with old
194** behavior: if there is no '__le', try '__lt', based on l <= r iff
195** !(r < l) (assuming a total order). If the metamethod yields during
196** this substitution, the continuation has to know about it (to negate
197** the result of r<l); bit CIST_LEQ in the call status keeps that
198** information.
199*/
191int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, 200int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2,
192 TMS event) { 201 TMS event) {
193 if (callbinTM(L, p1, p2, L->top, event)) /* try original event */ 202 if (callbinTM(L, p1, p2, L->top, event)) /* try original event */
diff --git a/lvm.c b/lvm.c
index b8d6e828..78c0ebe7 100644
--- a/lvm.c
+++ b/lvm.c
@@ -541,11 +541,6 @@ int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) {
541 541
542/* 542/*
543** return 'l <= r' for non-numbers. 543** return 'l <= r' for non-numbers.
544** If it needs a metamethod and there is no '__le', try '__lt', based
545** on l <= r iff !(r < l) (assuming a total order). If the metamethod
546** yields during this substitution, the continuation has to know about
547** it (to negate the result of r<l); bit CIST_LEQ in the call status
548** keeps that information.
549*/ 544*/
550static int lessequalothers (lua_State *L, const TValue *l, const TValue *r) { 545static int lessequalothers (lua_State *L, const TValue *l, const TValue *r) {
551 lua_assert(!ttisnumber(l) || !ttisnumber(r)); 546 lua_assert(!ttisnumber(l) || !ttisnumber(r));
@@ -986,7 +981,9 @@ void luaV_finishOp (lua_State *L) {
986 981
987 982
988/* 983/*
989** Order operations with register operands. 984** Order operations with register operands. 'opf' actually works
985** for all numbers, but the fast track improves performance for
986** integers.
990*/ 987*/
991#define op_order(L,opi,opf,other) { \ 988#define op_order(L,opi,opf,other) { \
992 int cond; \ 989 int cond; \