1
0

012-lnum-fix-ltle-relational-operators.patch 753 B

12345678910111213141516171819202122
  1. --- a/src/lvm.c
  2. +++ b/src/lvm.c
  3. @@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T
  4. else
  5. return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) );
  6. - } else if ((res = call_orderTM(L, l, r, TM_LT)) != -1)
  7. + }
  8. + if ((res = call_orderTM(L, l, r, TM_LT)) != -1)
  9. return res;
  10. return luaG_ordererror(L, l, r);
  11. @@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons
  12. else
  13. return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) );
  14. - } else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */
  15. + }
  16. + if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */
  17. return res;
  18. else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */
  19. return !res;