lua: update to v5.1.5, refresh patches
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 10 Oct 2012 17:53:46 +0000 (17:53 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 10 Oct 2012 17:53:46 +0000 (17:53 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33707 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/lua/Makefile
package/lua/patches/010-lua-5.1.3-lnum-full-260308.patch
package/lua/patches/020-shared_liblua.patch
package/lua/patches/300-opcode_performance.patch

index 53acdde..c5df4d5 100644 (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.
 # See /LICENSE for more information.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua
-PKG_VERSION:=5.1.4
-PKG_RELEASE:=8
+PKG_VERSION:=5.1.5
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
        http://ftp.gwdg.de/pub/languages/lua/ \
        http://mirrors.dotsrc.org/lua/ \
        http://www.tecgraf.puc-rio.br/lua/ftp/
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
        http://ftp.gwdg.de/pub/languages/lua/ \
        http://mirrors.dotsrc.org/lua/ \
        http://www.tecgraf.puc-rio.br/lua/ftp/
-PKG_MD5SUM:=d0870f2de55d59c1c8419f36e8fac150
+PKG_MD5SUM:=2e115fe26e435e33b0d5c022e4490567
 
 HOST_PATCH_DIR := ./patches-host
 
 
 HOST_PATCH_DIR := ./patches-host
 
index 6190945..74b8c6f 100644 (file)
    lua_setglobal(L, "_VERSION");  /* set global _VERSION */
 +  lua_pushliteral(L, LUA_LNUM);
 +  lua_setglobal(L, "_LNUM");  /* "[complex] double|float|ldouble int32|int64" */
    lua_setglobal(L, "_VERSION");  /* set global _VERSION */
 +  lua_pushliteral(L, LUA_LNUM);
 +  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, "pairs", luaB_pairs, luaB_next);
 --- a/src/lcode.c
    auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
    auxopen(L, "pairs", luaB_pairs, luaB_next);
 --- a/src/lcode.c
        pc = NO_JUMP;  /* always true; do nothing */
        break;
      }
        pc = NO_JUMP;  /* always true; do nothing */
        break;
      }
-@@ -598,7 +643,10 @@ static void codenot (FuncState *fs, expd
+@@ -590,7 +635,10 @@ static void codenot (FuncState *fs, expd
        e->k = VTRUE;
        break;
      }
        e->k = VTRUE;
        break;
      }
        e->k = VFALSE;
        break;
      }
        e->k = VFALSE;
        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) {
    lua_Number v1, v2, r;
  
  static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
    lua_Number v1, v2, r;
    e1->u.nval = r;
    return 1;
  }
    e1->u.nval = r;
    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) {
    expdesc e2;
  
  void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
    expdesc e2;
    else
 --- a/src/ldo.c
 +++ b/src/ldo.c
    else
 --- a/src/ldo.c
 +++ b/src/ldo.c
-@@ -219,9 +219,9 @@ static StkId adjust_varargs (lua_State *
-     luaC_checkGC(L);
+@@ -220,9 +220,9 @@ static StkId adjust_varargs (lua_State *
+     luaD_checkstack(L, p->maxstacksize);
      htab = luaH_new(L, nvar, 1);  /* create `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);
      htab = luaH_new(L, nvar, 1);  /* create `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);
  
  static int read_number (lua_State *L, FILE *f) {
    lua_Number d;
  
  static int read_number (lua_State *L, FILE *f) {
    lua_Number d;
-@@ -279,6 +288,43 @@ static int read_number (lua_State *L, FI
-   else return 0;  /* read fails */
+@@ -282,6 +291,43 @@ static int read_number (lua_State *L, FI
+   }
  }
  
 +static int read_integer (lua_State *L, FILE *f) {
  }
  
 +static int read_integer (lua_State *L, FILE *f) {
  
  static int test_eof (lua_State *L, FILE *f) {
    int c = getc(f);
  
  static int test_eof (lua_State *L, FILE *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 */
              success = read_number(L, f);
              break;
            case 'n':  /* number */
              success = read_number(L, f);
              break;
            case 'l':  /* line */
              success = read_line(L, f);
              break;
            case 'l':  /* line */
              success = read_line(L, f);
              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;
    for (; nargs--; arg++) {
      if (lua_type(L, arg) == LUA_TNUMBER) {
    int status = 1;
    for (; nargs--; arg++) {
      if (lua_type(L, arg) == LUA_TNUMBER) {
      }
      else {
        size_t l;
      }
      else {
        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};
    FILE *f = tofile(L);
    int op = luaL_checkoption(L, 2, NULL, modenames);
    static const char *const modenames[] = {"no", "full", "line", NULL};
    FILE *f = tofile(L);
    int op = luaL_checkoption(L, 2, NULL, modenames);
        save(ls, '\0');
        return luaZ_buffer(ls->buff);
      default:
        save(ls, '\0');
        return luaZ_buffer(ls->buff);
      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;
  }
  
    lua_assert(isdigit(ls->current));
    do {
      save_and_next(ls);
    lua_assert(isdigit(ls->current));
    do {
      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(ls, '\0');
    buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */
      save_and_next(ls);
    save(ls, '\0');
    buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */
  }
  
  
  }
  
  
-@@ -329,6 +343,7 @@ static void read_string (LexState *ls, i
+@@ -331,6 +345,7 @@ static void read_string (LexState *ls, i
  }
  
  
  }
  
  
  static int llex (LexState *ls, SemInfo *seminfo) {
    luaZ_resetbuffer(ls->buff);
    for (;;) {
  static int llex (LexState *ls, SemInfo *seminfo) {
    luaZ_resetbuffer(ls->buff);
    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 {
          }
          else if (!isdigit(ls->current)) return '.';
          else {
          }
        }
        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;
          }
          else if (isdigit(ls->current)) {
            continue;
          }
          else if (isdigit(ls->current)) {
  }
  
  
  }
  
  
-@@ -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': {
            addintlen(form);
          }
          case 'd':  case 'i': {
            addintlen(form);
 +++ b/src/lua.h
 @@ -19,7 +19,7 @@
  #define LUA_VERSION   "Lua 5.1"
 +++ b/src/lua.h
 @@ -19,7 +19,7 @@
  #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-2008 Lua.org, PUC-Rio" " (" LUA_LNUM ")"
+-#define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio"
++#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"
  
  
      setsvalue2s(L, obj, luaS_new(L, s));
      return 1;
    }
      setsvalue2s(L, obj, luaS_new(L, s));
      return 1;
    }
-@@ -218,59 +230,127 @@ static int l_strcmp (const TString *ls, 
+@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, 
  }
  
  
  }
  
  
    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
  }
  
  
  }
  
  
  /*
  ** 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; }
  
  
  
  
  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;
        }
        case OP_ADD: {
          continue;
        }
        case OP_ADD: {
          continue;
        }
        case OP_NOT: {
          continue;
        }
        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);
          switch (ttype(rb)) {
            case LUA_TTABLE: {
          const TValue *rb = RB(i);
          switch (ttype(rb)) {
            case LUA_TTABLE: {
              break;
            }
            default: {  /* try metamethod */
              break;
            }
            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: {
          }
          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 *pstep = ra+2;
          L->savedpc = pc;  /* next steps may throw errors */
          const TValue *plimit = ra+1;
          const TValue *pstep = ra+2;
          L->savedpc = pc;  /* next steps may throw errors */
          dojump(L, pc, GETARG_sBx(i));
          continue;
        }
          dojump(L, pc, GETARG_sBx(i));
          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 */
          for (; n > 0; n--) {
            TValue *val = ra+n;
            luaH_resizearray(L, h, last);  /* pre-alloc it at once */
          for (; n > 0; n--) {
            TValue *val = ra+n;
index 18078cc..bcd410f 100644 (file)
 +so:   $(ALL_SO)
 +
  $(LUA_A): $(CORE_O) $(LIB_O)
 +so:   $(ALL_SO)
 +
  $(LUA_A): $(CORE_O) $(LIB_O)
-       $(AR) $@ $?
+       $(AR) $@ $(CORE_O) $(LIB_O)     # DLL needs all object files
        $(RANLIB) $@
  
 -$(LUA_T): $(LUA_O) $(LUA_A)
        $(RANLIB) $@
  
 -$(LUA_T): $(LUA_O) $(LUA_A)
index e870a25..5fbb873 100644 (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
  #endif
  
      ARITH_OP1_END
  #endif
  
@@ -74,7 +74,7 @@
   reentry:  /* entry point */
    lua_assert(isLua(L->ci));
    pc = L->savedpc;
   reentry:  /* entry point */
    lua_assert(isLua(L->ci));
    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->top && L->top <= L->stack + L->stacksize);
      lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
      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));
          TValue g;
          TValue *rb = KBx(i);
          sethvalue(L, &g, cl->env);
          TValue g;
          TValue *rb = KBx(i);
          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));
          continue;
        }
          Protect(luaV_gettable(L, &g, rb, ra));
          continue;
        }
          const TValue *rb = RB(i);
          switch (ttype(rb)) {
            case LUA_TTABLE: {
          const TValue *rb = RB(i);
          switch (ttype(rb)) {
            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;
        }
          TValue *rb = RKB(i);
          TValue *rc = RKC(i);
          Protect(
          TValue *rb = RKB(i);
          TValue *rc = RKC(i);
          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++;
          continue;
        }
          pc++;
          continue;
        }
          Protect(
            if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
              dojump(L, pc, GETARG_sBx(*pc));
          Protect(
            if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
              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++;
          continue;
        }
          pc++;
          continue;
        }
          Protect(
            if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
              dojump(L, pc, GETARG_sBx(*pc));
          Protect(
            if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
              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++;
          continue;
        }
          pc++;
          continue;
        }
          TValue *rb = RB(i);
          if (l_isfalse(rb) != GETARG_C(i)) {
            setobjs2s(L, ra, rb);
          TValue *rb = RB(i);
          if (l_isfalse(rb) != GETARG_C(i)) {
            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++;
          continue;
        }
          pc++;
          continue;
        }
          int b = GETARG_B(i);
          int nresults = GETARG_C(i) - 1;
          if (b != 0) L->top = ra+b;  /* else previous instruction set top */
          int b = GETARG_B(i);
          int nresults = GETARG_C(i) - 1;
          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
            }
          }
        }
            }
          }
        }
          int b = GETARG_B(i);
          if (b != 0) L->top = ra+b;  /* else previous instruction set top */
          L->savedpc = pc;
          int b = GETARG_B(i);
          if (b != 0) L->top = ra+b;  /* else previous instruction set top */
          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
            }
          }
        }
            }
          }
        }
          int b = GETARG_B(i);
          if (b != 0) L->top = ra+b-1;
          if (L->openupval) luaF_close(L, base);
          int b = GETARG_B(i);
          if (b != 0) L->top = ra+b-1;
          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;
          }
        }
          /* If start,step and limit are all integers, we don't need to check
           * against overflow in the looping.
           */
          /* If start,step and limit are all integers, we don't need to check
           * 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;
        }
          const TValue *init = ra;
          const TValue *plimit = ra+1;
          const TValue *pstep = ra+2;
          const TValue *init = ra;
          const TValue *plimit = ra+1;
          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));
          continue;
        }
          dojump(L, pc, GETARG_sBx(i));
          continue;
        }
          StkId cb = ra + 3;  /* call base */
          setobjs2s(L, cb+2, ra+2);
          setobjs2s(L, cb+1, ra+1);
          StkId cb = ra + 3;  /* call base */
          setobjs2s(L, cb+2, ra+2);
          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++;
          continue;
        }
          pc++;
          continue;
        }
          int n = GETARG_B(i);
          int c = GETARG_C(i);
          int last;
          int n = GETARG_B(i);
          int c = GETARG_C(i);
          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;
        }
          Proto *p;
          Closure *ncl;
          int nup, j;
          Proto *p;
          Closure *ncl;
          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));
          continue;
        }
          Protect(luaC_checkGC(L));
          continue;
        }