[LEDE-DEV] [PATCH v1] lua: clean up patch fuzz
Kevin Darbyshire-Bryant
ldir at darbyshire-bryant.me.uk
Thu Jan 4 12:07:59 PST 2018
Refresh patches to tidy up fuzz. No functional changes
Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
.../patches/010-lua-5.1.3-lnum-full-260308.patch | 47 +++++++++++-----------
.../012-lnum-fix-ltle-relational-operators.patch | 4 +-
package/utils/lua/patches/020-shared_liblua.patch | 2 +-
package/utils/lua/patches/050-honor-cflags.patch | 2 +-
.../utils/lua/patches/300-opcode_performance.patch | 32 +++++++--------
5 files changed, 44 insertions(+), 43 deletions(-)
diff --git a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
index 74b8c6f8f0..ac0722c707 100644
--- a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
+++ b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
@@ -62,7 +62,7 @@
return (t == LUA_TNONE) ? "no value" : luaT_typenames[t];
}
-@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L,
+@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L,
}
@@ -77,7 +77,7 @@
LUA_API int lua_isstring (lua_State *L, int idx) {
int t = lua_type(L, idx);
return (t == LUA_TSTRING || t == LUA_TNUMBER);
-@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L,
+@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L,
}
@@ -162,7 +162,7 @@
case LUA_TNUMBER: {
size_t l;
lua_lock(L); /* `luaV_tostring' may create a new string */
-@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L)
+@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L)
}
@@ -196,7 +196,7 @@
LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
-@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L,
+@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L,
lua_lock(L);
o = index2adr(L, idx);
api_check(L, ttistable(o));
@@ -205,7 +205,7 @@
api_incr_top(L);
lua_unlock(L);
}
-@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State
+@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State
case LUA_TUSERDATA:
mt = uvalue(obj)->metatable;
break;
@@ -215,7 +215,7 @@
default:
mt = G(L)->mt[ttype(obj)];
break;
-@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L,
+@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L,
api_checknelems(L, 1);
o = index2adr(L, idx);
api_check(L, ttistable(o));
@@ -224,7 +224,7 @@
luaC_barriert(L, hvalue(o), L->top-1);
L->top--;
lua_unlock(L);
-@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State
+@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State
break;
}
default: {
@@ -286,7 +286,7 @@
#define FREELIST_REF 0 /* free list of references */
-@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State
+@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State
static void tag_error (lua_State *L, int narg, int tag) {
@@ -351,7 +351,7 @@
-@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L)
+@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L)
int base = luaL_optint(L, 2, 10);
if (base == 10) { /* standard conversion */
luaL_checkany(L, 1);
@@ -503,7 +503,7 @@
case VKNUM:
case VTRUE:
case VFALSE:
-@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc
+@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc
if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */
e->u.s.info = (e->k == VNIL) ? nilK(fs) :
(e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
@@ -896,7 +896,7 @@
lua_assert(isdigit(ls->current));
do {
save_and_next(ls);
-@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls,
+@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls,
save_and_next(ls);
save(ls, '\0');
buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
@@ -1009,6 +1009,7 @@
-#define PI (3.14159265358979323846)
-#define RADIANS_PER_DEGREE (PI/180.0)
-
+-
+#ifdef LNUM_FLOAT
+# define PI (3.14159265358979323846F)
+#elif defined(M_PI)
@@ -1017,7 +1018,7 @@
+# define PI (3.14159265358979323846264338327950288)
+#endif
+#define RADIANS_PER_DEGREE (PI/180)
-
++
+#undef HUGE
+#ifdef LNUM_FLOAT
+# define HUGE HUGE_VALF
@@ -2103,7 +2104,7 @@
case LUA_TBOOLEAN:
return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */
case LUA_TLIGHTUSERDATA:
-@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1,
+@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1,
}
}
@@ -2606,7 +2607,7 @@
nums[ceillog2(k)]++; /* count as such */
return 1;
}
-@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table
+@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table
/* re-insert elements from vanishing slice */
for (i=nasize; i<oldasize; i++) {
if (!ttisnil(&t->array[i]))
@@ -2650,7 +2651,7 @@
} while (n);
return luaO_nilobject;
}
-@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const
+@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const
switch (ttype(key)) {
case LUA_TNIL: return luaO_nilobject;
case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key));
@@ -3061,7 +3062,7 @@
/*
@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
** CHANGE it if your system requires alignments larger than double. (For
-@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l;
+@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l;
#define luai_userstateyield(L,n) ((void)L)
@@ -3092,7 +3093,7 @@
/*
--- a/src/lundump.c
+++ b/src/lundump.c
-@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState*
+@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState*
return x;
}
@@ -3106,7 +3107,7 @@
static TString* LoadString(LoadState* S)
{
size_t size;
-@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S,
+@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S,
case LUA_TNUMBER:
setnvalue(o,LoadNumber(S));
break;
@@ -3198,7 +3199,7 @@
setsvalue2s(L, obj, luaS_new(L, s));
return 1;
}
-@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls,
+@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls,
}
@@ -3421,10 +3422,10 @@
+ case TM_POW: if (try_powint( ri, ib, ic)) return; break;
+ case TM_UNM: if (try_unmint( ri, ib)) return; break;
+ default: lua_assert(0);
-+ }
+ }
+ }
+ /* Fallback to floating point, when leaving range. */
-+
+
+#ifdef LNUM_COMPLEX
+ if ((nvalue_img(b)!=0) || (nvalue_img(c)!=0)) {
+ lua_Complex r;
@@ -3444,7 +3445,7 @@
+ default: lua_assert(0); r=0;
+ }
+ setnvalue_complex( ra, r );
- }
++ }
+ return;
+ }
+#endif
@@ -3465,7 +3466,7 @@
+ if (!call_binTM(L, rb, rc, ra, op))
+ luaG_aritherror(L, rb, rc);
+}
-
++
+/* Helper macro to sort arithmetic operations into four categories:
+ * TK_INT: integer - integer operands
+ * TK_NUMBER: number - number (non complex, either may be integer)
diff --git a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
index 937fc137e8..3d3d6850e2 100644
--- a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
+++ b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch
@@ -1,6 +1,6 @@
--- a/src/lvm.c
+++ b/src/lvm.c
-@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T
+@@ -281,7 +281,8 @@ int luaV_lessthan (lua_State *L, const T
else
return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) );
@@ -10,7 +10,7 @@
return res;
return luaG_ordererror(L, l, r);
-@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons
+@@ -319,7 +320,8 @@ static int lessequal (lua_State *L, cons
else
return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) );
diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch
index bcd410f690..64f683ddbe 100644
--- a/package/utils/lua/patches/020-shared_liblua.patch
+++ b/package/utils/lua/patches/020-shared_liblua.patch
@@ -21,7 +21,7 @@
ranlib:
--- a/src/ldo.h
+++ b/src/ldo.h
-@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L,
+@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L,
LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
diff --git a/package/utils/lua/patches/050-honor-cflags.patch b/package/utils/lua/patches/050-honor-cflags.patch
index dd65791482..d221c4ee9e 100644
--- a/package/utils/lua/patches/050-honor-cflags.patch
+++ b/package/utils/lua/patches/050-honor-cflags.patch
@@ -8,4 +8,4 @@
+ $(CC) -o $@.$(PKG_VERSION) -Wl,-Bsymbolic-functions $(MYLDFLAGS) -shared -Wl,-soname="$@.$(PKG_VERSION)" $?
ln -fs $@.$(PKG_VERSION) $@
-
+ $(LUA_T): $(LUA_O) $(LUA_SO)
diff --git a/package/utils/lua/patches/300-opcode_performance.patch b/package/utils/lua/patches/300-opcode_performance.patch
index 5fbb87388a..b971e0975c 100644
--- a/package/utils/lua/patches/300-opcode_performance.patch
+++ b/package/utils/lua/patches/300-opcode_performance.patch
@@ -10,7 +10,7 @@
/*
* If 'obj' is a string, it is tried to be interpreted as a number.
-@@ -566,12 +569,63 @@ static inline int arith_mode( const TVal
+@@ -568,12 +571,63 @@ static inline int arith_mode( const TVal
ARITH_OP1_END
#endif
@@ -74,7 +74,7 @@
reentry: /* entry point */
lua_assert(isLua(L->ci));
pc = L->savedpc;
-@@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex
+@@ -598,33 +652,33 @@ void luaV_execute (lua_State *L, int nex
lua_assert(base == L->base && L->base == L->ci->base);
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
@@ -115,7 +115,7 @@
TValue g;
TValue *rb = KBx(i);
sethvalue(L, &g, cl->env);
-@@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex
+@@ -632,88 +686,88 @@ void luaV_execute (lua_State *L, int nex
Protect(luaV_gettable(L, &g, rb, ra));
continue;
}
@@ -219,7 +219,7 @@
const TValue *rb = RB(i);
switch (ttype(rb)) {
case LUA_TTABLE: {
-@@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex
+@@ -733,18 +787,18 @@ void luaV_execute (lua_State *L, int nex
}
continue;
}
@@ -241,7 +241,7 @@
TValue *rb = RKB(i);
TValue *rc = RKC(i);
Protect(
-@@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -754,7 +808,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
@@ -250,7 +250,7 @@
Protect(
if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
-@@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -762,7 +816,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
@@ -259,7 +259,7 @@
Protect(
if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
-@@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex
+@@ -770,13 +824,13 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
@@ -275,7 +275,7 @@
TValue *rb = RB(i);
if (l_isfalse(rb) != GETARG_C(i)) {
setobjs2s(L, ra, rb);
-@@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -785,7 +839,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
@@ -284,7 +284,7 @@
int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1;
if (b != 0) L->top = ra+b; /* else previous instruction set top */
-@@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -806,7 +860,7 @@ void luaV_execute (lua_State *L, int nex
}
}
}
@@ -293,7 +293,7 @@
int b = GETARG_B(i);
if (b != 0) L->top = ra+b; /* else previous instruction set top */
L->savedpc = pc;
-@@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -838,7 +892,7 @@ void luaV_execute (lua_State *L, int nex
}
}
}
@@ -302,7 +302,7 @@
int b = GETARG_B(i);
if (b != 0) L->top = ra+b-1;
if (L->openupval) luaF_close(L, base);
-@@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -853,7 +907,7 @@ void luaV_execute (lua_State *L, int nex
goto reentry;
}
}
@@ -311,7 +311,7 @@
/* If start,step and limit are all integers, we don't need to check
* against overflow in the looping.
*/
-@@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -881,7 +935,7 @@ void luaV_execute (lua_State *L, int nex
}
continue;
}
@@ -320,7 +320,7 @@
const TValue *init = ra;
const TValue *plimit = ra+1;
const TValue *pstep = ra+2;
-@@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -904,7 +958,7 @@ void luaV_execute (lua_State *L, int nex
dojump(L, pc, GETARG_sBx(i));
continue;
}
@@ -329,7 +329,7 @@
StkId cb = ra + 3; /* call base */
setobjs2s(L, cb+2, ra+2);
setobjs2s(L, cb+1, ra+1);
-@@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -920,7 +974,7 @@ void luaV_execute (lua_State *L, int nex
pc++;
continue;
}
@@ -338,7 +338,7 @@
int n = GETARG_B(i);
int c = GETARG_C(i);
int last;
-@@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex
+@@ -942,11 +996,11 @@ void luaV_execute (lua_State *L, int nex
}
continue;
}
@@ -352,7 +352,7 @@
Proto *p;
Closure *ncl;
int nup, j;
-@@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex
+@@ -966,7 +1020,7 @@ void luaV_execute (lua_State *L, int nex
Protect(luaC_checkGC(L));
continue;
}
--
2.14.3 (Apple Git-98)
More information about the Lede-dev
mailing list