aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/lua/patches-host/012-lnum-fix-ltle-relational-operators.patch
blob: 3d3d6850e215e4c4c2ff9735f5ac29ec7f9ef27b (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
@@ -281,7 +281,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);
@@ -319,7 +320,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;