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