lua: update to v5.1.5, refresh patches

SVN-Revision: 33707
This commit is contained in:
Jo-Philipp Wich 2012-10-10 17:53:46 +00:00
parent 5bb789340e
commit 109cf29629
4 changed files with 49 additions and 49 deletions

View file

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006-2011 OpenWrt.org # Copyright (C) 2006-2012 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -8,15 +8,15 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=lua PKG_NAME:=lua
PKG_VERSION:=5.1.4 PKG_VERSION:=5.1.5
PKG_RELEASE:=8 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lua.org/ftp/ \ PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
http://ftp.gwdg.de/pub/languages/lua/ \ http://ftp.gwdg.de/pub/languages/lua/ \
http://mirrors.dotsrc.org/lua/ \ http://mirrors.dotsrc.org/lua/ \
http://www.tecgraf.puc-rio.br/lua/ftp/ http://www.tecgraf.puc-rio.br/lua/ftp/
PKG_MD5SUM:=d0870f2de55d59c1c8419f36e8fac150 PKG_MD5SUM:=2e115fe26e435e33b0d5c022e4490567
HOST_PATCH_DIR := ./patches-host HOST_PATCH_DIR := ./patches-host

View file

@ -406,7 +406,7 @@
lua_setglobal(L, "_VERSION"); /* set global _VERSION */ lua_setglobal(L, "_VERSION"); /* set global _VERSION */
+ lua_pushliteral(L, LUA_LNUM); + lua_pushliteral(L, LUA_LNUM);
+ lua_setglobal(L, "_LNUM"); /* "[complex] double|float|ldouble int32|int64" */ + lua_setglobal(L, "_LNUM"); /* "[complex] double|float|ldouble int32|int64" */
/* `ipairs' and `pairs' need auxliliary functions as upvalues */ /* `ipairs' and `pairs' need auxiliary functions as upvalues */
auxopen(L, "ipairs", luaB_ipairs, ipairsaux); auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
auxopen(L, "pairs", luaB_pairs, luaB_next); auxopen(L, "pairs", luaB_pairs, luaB_next);
--- a/src/lcode.c --- a/src/lcode.c
@ -526,7 +526,7 @@
pc = NO_JUMP; /* always true; do nothing */ pc = NO_JUMP; /* always true; do nothing */
break; break;
} }
@@ -598,7 +643,10 @@ static void codenot (FuncState *fs, expd @@ -590,7 +635,10 @@ static void codenot (FuncState *fs, expd
e->k = VTRUE; e->k = VTRUE;
break; break;
} }
@ -538,7 +538,7 @@
e->k = VFALSE; e->k = VFALSE;
break; break;
} }
@@ -634,25 +682,70 @@ void luaK_indexed (FuncState *fs, expdes @@ -626,25 +674,70 @@ void luaK_indexed (FuncState *fs, expdes
static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
lua_Number v1, v2, r; lua_Number v1, v2, r;
@ -614,7 +614,7 @@
e1->u.nval = r; e1->u.nval = r;
return 1; return 1;
} }
@@ -696,7 +789,8 @@ static void codecomp (FuncState *fs, OpC @@ -688,7 +781,8 @@ static void codecomp (FuncState *fs, OpC
void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
expdesc e2; expdesc e2;
@ -667,8 +667,8 @@
else else
--- a/src/ldo.c --- a/src/ldo.c
+++ b/src/ldo.c +++ b/src/ldo.c
@@ -219,9 +219,9 @@ static StkId adjust_varargs (lua_State * @@ -220,9 +220,9 @@ static StkId adjust_varargs (lua_State *
luaC_checkGC(L); luaD_checkstack(L, p->maxstacksize);
htab = luaH_new(L, nvar, 1); /* create `arg' table */ htab = luaH_new(L, nvar, 1); /* create `arg' table */
for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */ for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */
- setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i); - setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);
@ -740,8 +740,8 @@
static int read_number (lua_State *L, FILE *f) { static int read_number (lua_State *L, FILE *f) {
lua_Number d; lua_Number d;
@@ -279,6 +288,43 @@ static int read_number (lua_State *L, FI @@ -282,6 +291,43 @@ static int read_number (lua_State *L, FI
else return 0; /* read fails */ }
} }
+static int read_integer (lua_State *L, FILE *f) { +static int read_integer (lua_State *L, FILE *f) {
@ -784,7 +784,7 @@
static int test_eof (lua_State *L, FILE *f) { static int test_eof (lua_State *L, FILE *f) {
int c = getc(f); int c = getc(f);
@@ -352,6 +398,14 @@ static int g_read (lua_State *L, FILE *f @@ -355,6 +401,14 @@ static int g_read (lua_State *L, FILE *f
case 'n': /* number */ case 'n': /* number */
success = read_number(L, f); success = read_number(L, f);
break; break;
@ -799,7 +799,7 @@
case 'l': /* line */ case 'l': /* line */
success = read_line(L, f); success = read_line(L, f);
break; break;
@@ -412,9 +466,10 @@ static int g_write (lua_State *L, FILE * @@ -415,9 +469,10 @@ static int g_write (lua_State *L, FILE *
int status = 1; int status = 1;
for (; nargs--; arg++) { for (; nargs--; arg++) {
if (lua_type(L, arg) == LUA_TNUMBER) { if (lua_type(L, arg) == LUA_TNUMBER) {
@ -813,7 +813,7 @@
} }
else { else {
size_t l; size_t l;
@@ -457,7 +512,7 @@ static int f_setvbuf (lua_State *L) { @@ -460,7 +515,7 @@ static int f_setvbuf (lua_State *L) {
static const char *const modenames[] = {"no", "full", "line", NULL}; static const char *const modenames[] = {"no", "full", "line", NULL};
FILE *f = tofile(L); FILE *f = tofile(L);
int op = luaL_checkoption(L, 2, NULL, modenames); int op = luaL_checkoption(L, 2, NULL, modenames);
@ -863,7 +863,7 @@
save(ls, '\0'); save(ls, '\0');
return luaZ_buffer(ls->buff); return luaZ_buffer(ls->buff);
default: default:
@@ -173,23 +182,27 @@ static void buffreplace (LexState *ls, c @@ -175,23 +184,27 @@ static void buffreplace (LexState *ls, c
if (p[n] == from) p[n] = to; if (p[n] == from) p[n] = to;
} }
@ -896,7 +896,7 @@
lua_assert(isdigit(ls->current)); lua_assert(isdigit(ls->current));
do { do {
save_and_next(ls); save_and_next(ls);
@@ -200,8 +213,9 @@ static void read_numeral (LexState *ls, @@ -202,8 +215,9 @@ static void read_numeral (LexState *ls,
save_and_next(ls); save_and_next(ls);
save(ls, '\0'); save(ls, '\0');
buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
@ -908,7 +908,7 @@
} }
@@ -329,6 +343,7 @@ static void read_string (LexState *ls, i @@ -331,6 +345,7 @@ static void read_string (LexState *ls, i
} }
@ -916,7 +916,7 @@
static int llex (LexState *ls, SemInfo *seminfo) { static int llex (LexState *ls, SemInfo *seminfo) {
luaZ_resetbuffer(ls->buff); luaZ_resetbuffer(ls->buff);
for (;;) { for (;;) {
@@ -400,8 +415,7 @@ static int llex (LexState *ls, SemInfo * @@ -402,8 +417,7 @@ static int llex (LexState *ls, SemInfo *
} }
else if (!isdigit(ls->current)) return '.'; else if (!isdigit(ls->current)) return '.';
else { else {
@ -926,7 +926,7 @@
} }
} }
case EOZ: { case EOZ: {
@@ -414,8 +428,7 @@ static int llex (LexState *ls, SemInfo * @@ -416,8 +430,7 @@ static int llex (LexState *ls, SemInfo *
continue; continue;
} }
else if (isdigit(ls->current)) { else if (isdigit(ls->current)) {
@ -2438,7 +2438,7 @@
} }
@@ -777,12 +777,12 @@ static int str_format (lua_State *L) { @@ -779,12 +779,12 @@ static int str_format (lua_State *L) {
} }
case 'd': case 'i': { case 'd': case 'i': {
addintlen(form); addintlen(form);
@ -2792,10 +2792,10 @@
+++ b/src/lua.h +++ b/src/lua.h
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
#define LUA_VERSION "Lua 5.1" #define LUA_VERSION "Lua 5.1"
#define LUA_RELEASE "Lua 5.1.4" #define LUA_RELEASE "Lua 5.1.5"
#define LUA_VERSION_NUM 501 #define LUA_VERSION_NUM 501
-#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" -#define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio"
+#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" " (" LUA_LNUM ")" +#define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio" " (" LUA_LNUM ")"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
@ -3198,7 +3198,7 @@
setsvalue2s(L, obj, luaS_new(L, s)); setsvalue2s(L, obj, luaS_new(L, s));
return 1; return 1;
} }
@@ -218,59 +230,127 @@ static int l_strcmp (const TString *ls, @@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls,
} }
@ -3351,7 +3351,7 @@
return !l_isfalse(L->top); return !l_isfalse(L->top);
} }
@@ -310,30 +390,6 @@ void luaV_concat (lua_State *L, int tota @@ -314,30 +394,6 @@ void luaV_concat (lua_State *L, int tota
} }
@ -3382,7 +3382,7 @@
/* /*
** some macros for common tasks in `luaV_execute' ** some macros for common tasks in `luaV_execute'
*/ */
@@ -357,17 +413,154 @@ static void Arith (lua_State *L, StkId r @@ -361,17 +417,154 @@ static void Arith (lua_State *L, StkId r
#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } #define Protect(x) { L->savedpc = pc; {x;}; base = L->base; }
@ -3546,7 +3546,7 @@
void luaV_execute (lua_State *L, int nexeccalls) { void luaV_execute (lua_State *L, int nexeccalls) {
@@ -468,38 +661,45 @@ void luaV_execute (lua_State *L, int nex @@ -472,38 +665,45 @@ void luaV_execute (lua_State *L, int nex
continue; continue;
} }
case OP_ADD: { case OP_ADD: {
@ -3605,7 +3605,7 @@
continue; continue;
} }
case OP_NOT: { case OP_NOT: {
@@ -511,11 +711,11 @@ void luaV_execute (lua_State *L, int nex @@ -515,11 +715,11 @@ void luaV_execute (lua_State *L, int nex
const TValue *rb = RB(i); const TValue *rb = RB(i);
switch (ttype(rb)) { switch (ttype(rb)) {
case LUA_TTABLE: { case LUA_TTABLE: {
@ -3619,7 +3619,7 @@
break; break;
} }
default: { /* try metamethod */ default: { /* try metamethod */
@@ -648,14 +848,30 @@ void luaV_execute (lua_State *L, int nex @@ -652,14 +852,30 @@ void luaV_execute (lua_State *L, int nex
} }
} }
case OP_FORLOOP: { case OP_FORLOOP: {
@ -3658,7 +3658,7 @@
} }
continue; continue;
} }
@@ -664,13 +880,21 @@ void luaV_execute (lua_State *L, int nex @@ -668,13 +884,21 @@ void luaV_execute (lua_State *L, int nex
const TValue *plimit = ra+1; const TValue *plimit = ra+1;
const TValue *pstep = ra+2; const TValue *pstep = ra+2;
L->savedpc = pc; /* next steps may throw errors */ L->savedpc = pc; /* next steps may throw errors */
@ -3681,7 +3681,7 @@
dojump(L, pc, GETARG_sBx(i)); dojump(L, pc, GETARG_sBx(i));
continue; continue;
} }
@@ -707,7 +931,7 @@ void luaV_execute (lua_State *L, int nex @@ -711,7 +935,7 @@ void luaV_execute (lua_State *L, int nex
luaH_resizearray(L, h, last); /* pre-alloc it at once */ luaH_resizearray(L, h, last); /* pre-alloc it at once */
for (; n > 0; n--) { for (; n > 0; n--) {
TValue *val = ra+n; TValue *val = ra+n;

View file

@ -109,7 +109,7 @@
+so: $(ALL_SO) +so: $(ALL_SO)
+ +
$(LUA_A): $(CORE_O) $(LIB_O) $(LUA_A): $(CORE_O) $(LIB_O)
$(AR) $@ $? $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
$(RANLIB) $@ $(RANLIB) $@
-$(LUA_T): $(LUA_O) $(LUA_A) -$(LUA_T): $(LUA_O) $(LUA_A)

View file

@ -10,7 +10,7 @@
/* /*
* If 'obj' is a string, it is tried to be interpreted as a number. * If 'obj' is a string, it is tried to be interpreted as a number.
@@ -562,12 +565,63 @@ static inline int arith_mode( const TVal @@ -566,12 +569,63 @@ static inline int arith_mode( const TVal
ARITH_OP1_END ARITH_OP1_END
#endif #endif
@ -74,7 +74,7 @@
reentry: /* entry point */ reentry: /* entry point */
lua_assert(isLua(L->ci)); lua_assert(isLua(L->ci));
pc = L->savedpc; pc = L->savedpc;
@@ -592,33 +646,33 @@ void luaV_execute (lua_State *L, int nex @@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex
lua_assert(base == L->base && L->base == L->ci->base); lua_assert(base == L->base && L->base == L->ci->base);
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
@ -115,7 +115,7 @@
TValue g; TValue g;
TValue *rb = KBx(i); TValue *rb = KBx(i);
sethvalue(L, &g, cl->env); sethvalue(L, &g, cl->env);
@@ -626,88 +680,88 @@ void luaV_execute (lua_State *L, int nex @@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex
Protect(luaV_gettable(L, &g, rb, ra)); Protect(luaV_gettable(L, &g, rb, ra));
continue; continue;
} }
@ -219,7 +219,7 @@
const TValue *rb = RB(i); const TValue *rb = RB(i);
switch (ttype(rb)) { switch (ttype(rb)) {
case LUA_TTABLE: { case LUA_TTABLE: {
@@ -727,18 +781,18 @@ void luaV_execute (lua_State *L, int nex @@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex
} }
continue; continue;
} }
@ -241,7 +241,7 @@
TValue *rb = RKB(i); TValue *rb = RKB(i);
TValue *rc = RKC(i); TValue *rc = RKC(i);
Protect( Protect(
@@ -748,7 +802,7 @@ void luaV_execute (lua_State *L, int nex @@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex
pc++; pc++;
continue; continue;
} }
@ -250,7 +250,7 @@
Protect( Protect(
if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc)); dojump(L, pc, GETARG_sBx(*pc));
@@ -756,7 +810,7 @@ void luaV_execute (lua_State *L, int nex @@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex
pc++; pc++;
continue; continue;
} }
@ -259,7 +259,7 @@
Protect( Protect(
if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc)); dojump(L, pc, GETARG_sBx(*pc));
@@ -764,13 +818,13 @@ void luaV_execute (lua_State *L, int nex @@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex
pc++; pc++;
continue; continue;
} }
@ -275,7 +275,7 @@
TValue *rb = RB(i); TValue *rb = RB(i);
if (l_isfalse(rb) != GETARG_C(i)) { if (l_isfalse(rb) != GETARG_C(i)) {
setobjs2s(L, ra, rb); setobjs2s(L, ra, rb);
@@ -779,7 +833,7 @@ void luaV_execute (lua_State *L, int nex @@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex
pc++; pc++;
continue; continue;
} }
@ -284,7 +284,7 @@
int b = GETARG_B(i); int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1; int nresults = GETARG_C(i) - 1;
if (b != 0) L->top = ra+b; /* else previous instruction set top */ if (b != 0) L->top = ra+b; /* else previous instruction set top */
@@ -800,7 +854,7 @@ void luaV_execute (lua_State *L, int nex @@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex
} }
} }
} }
@ -293,7 +293,7 @@
int b = GETARG_B(i); int b = GETARG_B(i);
if (b != 0) L->top = ra+b; /* else previous instruction set top */ if (b != 0) L->top = ra+b; /* else previous instruction set top */
L->savedpc = pc; L->savedpc = pc;
@@ -832,7 +886,7 @@ void luaV_execute (lua_State *L, int nex @@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex
} }
} }
} }
@ -302,7 +302,7 @@
int b = GETARG_B(i); int b = GETARG_B(i);
if (b != 0) L->top = ra+b-1; if (b != 0) L->top = ra+b-1;
if (L->openupval) luaF_close(L, base); if (L->openupval) luaF_close(L, base);
@@ -847,7 +901,7 @@ void luaV_execute (lua_State *L, int nex @@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex
goto reentry; goto reentry;
} }
} }
@ -311,7 +311,7 @@
/* If start,step and limit are all integers, we don't need to check /* If start,step and limit are all integers, we don't need to check
* against overflow in the looping. * against overflow in the looping.
*/ */
@@ -875,7 +929,7 @@ void luaV_execute (lua_State *L, int nex @@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex
} }
continue; continue;
} }
@ -320,7 +320,7 @@
const TValue *init = ra; const TValue *init = ra;
const TValue *plimit = ra+1; const TValue *plimit = ra+1;
const TValue *pstep = ra+2; const TValue *pstep = ra+2;
@@ -898,7 +952,7 @@ void luaV_execute (lua_State *L, int nex @@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex
dojump(L, pc, GETARG_sBx(i)); dojump(L, pc, GETARG_sBx(i));
continue; continue;
} }
@ -329,7 +329,7 @@
StkId cb = ra + 3; /* call base */ StkId cb = ra + 3; /* call base */
setobjs2s(L, cb+2, ra+2); setobjs2s(L, cb+2, ra+2);
setobjs2s(L, cb+1, ra+1); setobjs2s(L, cb+1, ra+1);
@@ -914,7 +968,7 @@ void luaV_execute (lua_State *L, int nex @@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex
pc++; pc++;
continue; continue;
} }
@ -338,7 +338,7 @@
int n = GETARG_B(i); int n = GETARG_B(i);
int c = GETARG_C(i); int c = GETARG_C(i);
int last; int last;
@@ -936,11 +990,11 @@ void luaV_execute (lua_State *L, int nex @@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex
} }
continue; continue;
} }
@ -352,7 +352,7 @@
Proto *p; Proto *p;
Closure *ncl; Closure *ncl;
int nup, j; int nup, j;
@@ -960,7 +1014,7 @@ void luaV_execute (lua_State *L, int nex @@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex
Protect(luaC_checkGC(L)); Protect(luaC_checkGC(L));
continue; continue;
} }