aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
blob: 937fc137e859217202f42dd25e554a56e4ef9b09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T
     else
         return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) );
 
-  } else if ((res = call_orderTM(L, l, r, TM_LT)) != -1)
+  } 
+  if ((res = call_orderTM(L, l, r, TM_LT)) != -1)
     return res;
 
   return luaG_ordererror(L, l, r);
@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons
     else
         return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) );
 
-  } else if ((res = call_orderTM(L, l, r, TM_LE)) != -1)  /* first try `le' */
+  } 
+  if ((res = call_orderTM(L, l, r, TM_LE)) != -1)  /* first try `le' */
     return res;
   else if ((res = call_orderTM(L, r, l, TM_LT)) != -1)  /* else try `lt' */
     return !res;