Author: cazfi
Date: Sat Mar 21 19:02:16 2015
New Revision: 28595

URL: http://svn.gna.org/viewcvs/freeciv?rev=28595&view=rev
Log:
Updated included lua to version 5.2.4

See patch #5939

Modified:
    branches/S2_5/dependencies/lua-5.2/README
    branches/S2_5/dependencies/lua-5.2/Version
    branches/S2_5/dependencies/lua-5.2/doc/readme.html
    branches/S2_5/dependencies/lua-5.2/src/ldblib.c
    branches/S2_5/dependencies/lua-5.2/src/ldebug.c
    branches/S2_5/dependencies/lua-5.2/src/lgc.c
    branches/S2_5/dependencies/lua-5.2/src/llex.c
    branches/S2_5/dependencies/lua-5.2/src/lobject.h
    branches/S2_5/dependencies/lua-5.2/src/lopcodes.h
    branches/S2_5/dependencies/lua-5.2/src/ltablib.c
    branches/S2_5/dependencies/lua-5.2/src/lua.h
    branches/S2_5/dependencies/lua-5.2/src/luaconf.h

Modified: branches/S2_5/dependencies/lua-5.2/README
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/README?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/README   (original)
+++ branches/S2_5/dependencies/lua-5.2/README   Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 
-This is Lua 5.2.3, released on 11 Nov 2013.
+This is Lua 5.2.4, released on 25 Feb 2015.
 
 For installation instructions, license details, and
 further information about Lua, see doc/readme.html.

Modified: branches/S2_5/dependencies/lua-5.2/Version
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/Version?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/Version  (original)
+++ branches/S2_5/dependencies/lua-5.2/Version  Sat Mar 21 19:02:16 2015
@@ -1,6 +1,4 @@
-Sources here are from lua-5.2.3 (http://www.lua.org/ftp/lua-5.2.3.tar.gz)
-All applicable official lua.org patches, as of 17-Feb-15, have been applied.
-That is patches 2 and 3.
+Sources here are from lua-5.2.4 (http://www.lua.org/ftp/lua-5.2.4.tar.gz)
 
 Not entire lua distribution directory hierarchy is included here, and
 some files needed for Freeciv usage have been added.

Modified: branches/S2_5/dependencies/lua-5.2/doc/readme.html
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/doc/readme.html?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/doc/readme.html  (original)
+++ branches/S2_5/dependencies/lua-5.2/doc/readme.html  Sat Mar 21 19:02:16 2015
@@ -98,8 +98,8 @@
 get a binary from
 <A HREF="http://lua-users.org/wiki/LuaBinaries";>LuaBinaries</A>.
 Try also
-<A HREF="http://luaforwindows.luaforge.net/";>Lua for Windows</A>,
-an easy-to-use distribution of Lua that includes many useful libraries.
+<A HREF="http://luadist.org/";>LuaDist</A>,
+a multi-platform distribution of Lua that includes batteries.
 
 <H3>Building Lua</H3>
 
@@ -110,8 +110,8 @@
 <OL>
 <LI>
 Open a terminal window and move to
-the top-level directory, which is named <TT>lua-5.2.3</TT>.
-The Makefile there controls both the build process and the installation 
process.
+the top-level directory, which is named <TT>lua-5.2.x</TT>.
+The <TT>Makefile</TT> there controls both the build process and the 
installation process.
 <P>
 <LI>
   Do "<KBD>make</KBD>" and see if your platform is listed.
@@ -136,11 +136,12 @@
 <P>
 <LI>
   To check that Lua has been built correctly, do "<KBD>make test</KBD>"
-  after building Lua. This will run the interpreter and print its version 
string.
+  after building Lua. This will run the interpreter and print its version.
 </OL>
 <P>
 If you're running Linux and get compilation errors,
-make sure you have installed the <TT>readline</TT> development package.
+make sure you have installed the <TT>readline</TT> development package
+(which is probably named <TT>libreadline-dev</TT> or <TT>readline-devel</TT>).
 If you get link errors after that,
 then try "<KBD>make linux MYLIBS=-ltermcap</KBD>".
 
@@ -148,7 +149,7 @@
 <P>
   Once you have built Lua, you may want to install it in an official
   place in your system. In this case, do "<KBD>make install</KBD>". The 
official
-  place and the way to install files are defined in the Makefile. You'll
+  place and the way to install files are defined in the <TT>Makefile</TT>. 
You'll
   probably need the right permissions to install files.
 
 <P>
@@ -158,11 +159,13 @@
 <P>
   To install Lua locally, do "<KBD>make local</KBD>".
   This will create a directory <TT>install</TT> with subdirectories
-  <TT>bin</TT>, <TT>include</TT>, <TT>lib</TT>, <TT>man</TT>,
+  <TT>bin</TT>, <TT>include</TT>, <TT>lib</TT>, <TT>man</TT>, <TT>share</TT>,
   and install Lua as listed below.
 
   To install Lua locally, but in some other directory, do
   "<KBD>make install INSTALL_TOP=xxx</KBD>", where xxx is your chosen 
directory.
+  The installation starts in the <TT>src</TT> and <TT>doc</TT> directories,
+  so take care if <TT>INSTALL_TOP</TT> is not an absolute path.
 
 <DL CLASS="display">
 <DT>
@@ -186,8 +189,8 @@
 <P>
   These are the only directories you need for development.
   If you only want to run Lua programs,
-  you only need the files in bin and man.
-  The files in include and lib are needed for
+  you only need the files in <TT>bin</TT> and <TT>man</TT>.
+  The files in <TT>include</TT> and <TT>lib</TT> are needed for
   embedding Lua in C or C++ programs.
 
 <H3><A NAME="customization">Customization</A></H3>
@@ -203,7 +206,7 @@
   You don't actually need to edit the Makefiles because you may set the
   relevant variables in the command line when invoking make.
   Nevertheless, it's probably best to edit and save the Makefiles to
-  record the changes you need.
+  record the changes you've made.
 
 <P>
   On the other hand, if you need to customize some Lua features, you'll need
@@ -254,6 +257,7 @@
   be linked statically into the host program and its symbols exported for
   dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter.
   For Windows, we recommend that the Lua library be a DLL.
+  In all cases, the compiler luac should be linked statically.
 
 <P>
   As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize
@@ -375,7 +379,7 @@
 <A HREF="http://www.lua.org/license.html";>this</A>.
 
 <BLOCKQUOTE STYLE="padding-bottom: 0em">
-Copyright &copy; 1994&ndash;2013 Lua.org, PUC-Rio.
+Copyright &copy; 1994&ndash;2015 Lua.org, PUC-Rio.
 
 <P>
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -403,10 +407,10 @@
 <HR>
 <SMALL CLASS="footer">
 Last update:
-Sat Nov  9 22:39:16 BRST 2013
+Mon Feb 23 22:25:08 BRT 2015
 </SMALL>
 <!--
-Last change: revised for Lua 5.2.3
+Last change: revised for Lua 5.2.4
 -->
 
 </BODY>

Modified: branches/S2_5/dependencies/lua-5.2/src/ldblib.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/ldblib.c?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/ldblib.c     (original)
+++ branches/S2_5/dependencies/lua-5.2/src/ldblib.c     Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: ldblib.c,v 1.132.1.1 2013/04/12 18:48:47 roberto Exp $
+** $Id: ldblib.c,v 1.132.1.2 2015/02/19 17:16:55 roberto Exp $
 ** Interface from Lua to its debug API
 ** See Copyright Notice in lua.h
 */
@@ -20,6 +20,11 @@
 
 #define HOOKKEY                "_HKEY"
 
+
+static void checkstack (lua_State *L, lua_State *L1, int n) {
+  if (L != L1 && !lua_checkstack(L1, n))
+    luaL_error(L, "stack overflow");
+}
 
 
 static int db_getregistry (lua_State *L) {
@@ -114,6 +119,7 @@
   int arg;
   lua_State *L1 = getthread(L, &arg);
   const char *options = luaL_optstring(L, arg+2, "flnStu");
+  checkstack(L, L1, 3);
   if (lua_isnumber(L, arg+1)) {
     if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) {
       lua_pushnil(L);  /* level out of range */
@@ -173,6 +179,7 @@
   else {  /* stack-level argument */
     if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))  /* out of range? */
       return luaL_argerror(L, arg+1, "level out of range");
+    checkstack(L, L1, 1);
     name = lua_getlocal(L1, &ar, nvar);
     if (name) {
       lua_xmove(L1, L, 1);  /* push local value */
@@ -196,6 +203,7 @@
     return luaL_argerror(L, arg+1, "level out of range");
   luaL_checkany(L, arg+3);
   lua_settop(L, arg+3);
+  checkstack(L, L1, 1);
   lua_xmove(L, L1, 1);
   lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2)));
   return 1;
@@ -313,6 +321,7 @@
     lua_pushvalue(L, -1);
     lua_setmetatable(L, -2);  /* setmetatable(hooktable) = hooktable */
   }
+  checkstack(L, L1, 1);
   lua_pushthread(L1); lua_xmove(L1, L, 1);
   lua_pushvalue(L, arg+1);
   lua_rawset(L, -3);  /* set new hook */
@@ -331,6 +340,7 @@
     lua_pushliteral(L, "external hook");
   else {
     gethooktable(L);
+    checkstack(L, L1, 1);
     lua_pushthread(L1); lua_xmove(L1, L, 1);
     lua_rawget(L, -2);   /* get hook */
     lua_remove(L, -2);  /* remove hook table */

Modified: branches/S2_5/dependencies/lua-5.2/src/ldebug.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/ldebug.c?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/ldebug.c     (original)
+++ branches/S2_5/dependencies/lua-5.2/src/ldebug.c     Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: ldebug.c,v 2.90.1.3 2013/05/16 16:04:15 roberto Exp $
+** $Id: ldebug.c,v 2.90.1.4 2015/02/19 17:05:13 roberto Exp $
 ** Debug Interface
 ** See Copyright Notice in lua.h
 */
@@ -47,6 +47,16 @@
 }
 
 
+static void swapextra (lua_State *L) {
+  if (L->status == LUA_YIELD) {
+    CallInfo *ci = L->ci;  /* get function that yielded */
+    StkId temp = ci->func;  /* exchange its 'func' and 'extra' values */
+    ci->func = restorestack(L, ci->extra);
+    ci->extra = savestack(L, temp);
+  }
+}
+
+
 /*
 ** this function can be called asynchronous (e.g. during a signal)
 */
@@ -144,6 +154,7 @@
 LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
   const char *name;
   lua_lock(L);
+  swapextra(L);
   if (ar == NULL) {  /* information about non-active function? */
     if (!isLfunction(L->top - 1))  /* not a Lua function? */
       name = NULL;
@@ -158,6 +169,7 @@
       api_incr_top(L);
     }
   }
+  swapextra(L);
   lua_unlock(L);
   return name;
 }
@@ -165,11 +177,14 @@
 
 LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
   StkId pos = 0;  /* to avoid warnings */
-  const char *name = findlocal(L, ar->i_ci, n, &pos);
+  const char *name;
   lua_lock(L);
+  swapextra(L);
+  name = findlocal(L, ar->i_ci, n, &pos);
   if (name)
     setobjs2s(L, pos, L->top - 1);
   L->top--;  /* pop value */
+  swapextra(L);
   lua_unlock(L);
   return name;
 }
@@ -269,6 +284,7 @@
   CallInfo *ci;
   StkId func;
   lua_lock(L);
+  swapextra(L);
   if (*what == '>') {
     ci = NULL;
     func = L->top - 1;
@@ -287,6 +303,7 @@
     setobjs2s(L, L->top, func);
     api_incr_top(L);
   }
+  swapextra(L);
   if (strchr(what, 'L'))
     collectvalidlines(L, cl);
   lua_unlock(L);

Modified: branches/S2_5/dependencies/lua-5.2/src/lgc.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/lgc.c?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/lgc.c        (original)
+++ branches/S2_5/dependencies/lua-5.2/src/lgc.c        Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: lgc.c,v 2.140.1.2 2013/04/26 18:22:05 roberto Exp $
+** $Id: lgc.c,v 2.140.1.3 2014/09/01 16:55:08 roberto Exp $
 ** Garbage Collector
 ** See Copyright Notice in lua.h
 */

Modified: branches/S2_5/dependencies/lua-5.2/src/llex.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/llex.c?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/llex.c       (original)
+++ branches/S2_5/dependencies/lua-5.2/src/llex.c       Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: llex.c,v 2.63.1.2 2013/08/30 15:49:41 roberto Exp $
+** $Id: llex.c,v 2.63.1.3 2015/02/09 17:56:34 roberto Exp $
 ** Lexical Analyzer
 ** See Copyright Notice in lua.h
 */

Modified: branches/S2_5/dependencies/lua-5.2/src/lobject.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/lobject.h?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/lobject.h    (original)
+++ branches/S2_5/dependencies/lua-5.2/src/lobject.h    Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: lobject.h,v 2.71.1.1 2013/04/12 18:48:47 roberto Exp $
+** $Id: lobject.h,v 2.71.1.2 2014/05/07 14:14:58 roberto Exp $
 ** Type definitions for Lua objects
 ** See Copyright Notice in lua.h
 */
@@ -561,12 +561,12 @@
   CommonHeader;
   lu_byte flags;  /* 1<<p means tagmethod(p) is not present */
   lu_byte lsizenode;  /* log2 of size of `node' array */
-  struct Table *metatable;
+  int sizearray;  /* size of `array' array */
   TValue *array;  /* array part */
   Node *node;
   Node *lastfree;  /* any free position is before this position */
+  struct Table *metatable;
   GCObject *gclist;
-  int sizearray;  /* size of `array' array */
 } Table;
 
 

Modified: branches/S2_5/dependencies/lua-5.2/src/lopcodes.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/lopcodes.h?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/lopcodes.h   (original)
+++ branches/S2_5/dependencies/lua-5.2/src/lopcodes.h   Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: lopcodes.h,v 1.142.1.1 2013/04/12 18:48:47 roberto Exp $
+** $Id: lopcodes.h,v 1.142.1.2 2014/10/20 18:32:09 roberto Exp $
 ** Opcodes for Lua virtual machine
 ** See Copyright Notice in lua.h
 */
@@ -196,7 +196,7 @@
 
 OP_CONCAT,/*   A B C   R(A) := R(B).. ... ..R(C)                       */
 
-OP_JMP,/*      A sBx   pc+=sBx; if (A) close all upvalues >= R(A) + 1  */
+OP_JMP,/*      A sBx   pc+=sBx; if (A) close all upvalues >= R(A - 1)  */
 OP_EQ,/*       A B C   if ((RK(B) == RK(C)) ~= A) then pc++            */
 OP_LT,/*       A B C   if ((RK(B) <  RK(C)) ~= A) then pc++            */
 OP_LE,/*       A B C   if ((RK(B) <= RK(C)) ~= A) then pc++            */

Modified: branches/S2_5/dependencies/lua-5.2/src/ltablib.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/ltablib.c?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/ltablib.c    (original)
+++ branches/S2_5/dependencies/lua-5.2/src/ltablib.c    Sat Mar 21 19:02:16 2015
@@ -1,10 +1,11 @@
 /*
-** $Id: ltablib.c,v 1.65.1.1 2013/04/12 18:48:47 roberto Exp $
+** $Id: ltablib.c,v 1.65.1.2 2014/05/07 16:32:55 roberto Exp $
 ** Library for Table Manipulation
 ** See Copyright Notice in lua.h
 */
 
 
+#include <limits.h>
 #include <stddef.h>
 
 #define ltablib_c
@@ -134,13 +135,14 @@
 
 
 static int unpack (lua_State *L) {
-  int i, e, n;
+  int i, e;
+  unsigned int n;
   luaL_checktype(L, 1, LUA_TTABLE);
   i = luaL_optint(L, 2, 1);
   e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1));
   if (i > e) return 0;  /* empty range */
-  n = e - i + 1;  /* number of elements */
-  if (n <= 0 || !lua_checkstack(L, n))  /* n <= 0 means arith. overflow */
+  n = (unsigned int)e - (unsigned int)i;  /* number of elements minus 1 */
+  if (n > (INT_MAX - 10) || !lua_checkstack(L, ++n))
     return luaL_error(L, "too many results to unpack");
   lua_rawgeti(L, 1, i);  /* push arg[i] (avoiding overflow problems) */
   while (i++ < e)  /* push arg[i + 1...e] */

Modified: branches/S2_5/dependencies/lua-5.2/src/lua.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/lua.h?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/lua.h        (original)
+++ branches/S2_5/dependencies/lua-5.2/src/lua.h        Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: lua.h,v 1.285.1.2 2013/11/11 12:09:16 roberto Exp $
+** $Id: lua.h,v 1.285.1.4 2015/02/21 14:04:50 roberto Exp $
 ** Lua - A Scripting Language
 ** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
 ** See Copyright Notice at the end of this file
@@ -19,11 +19,11 @@
 #define LUA_VERSION_MAJOR      "5"
 #define LUA_VERSION_MINOR      "2"
 #define LUA_VERSION_NUM                502
-#define LUA_VERSION_RELEASE    "3"
+#define LUA_VERSION_RELEASE    "4"
 
 #define LUA_VERSION    "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
 #define LUA_RELEASE    LUA_VERSION "." LUA_VERSION_RELEASE
-#define LUA_COPYRIGHT  LUA_RELEASE "  Copyright (C) 1994-2013 Lua.org, PUC-Rio"
+#define LUA_COPYRIGHT  LUA_RELEASE "  Copyright (C) 1994-2015 Lua.org, PUC-Rio"
 #define LUA_AUTHORS    "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
 
 
@@ -418,7 +418,7 @@
 
 
 /******************************************************************************
-* Copyright (C) 1994-2013 Lua.org, PUC-Rio.
+* Copyright (C) 1994-2015 Lua.org, PUC-Rio.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the

Modified: branches/S2_5/dependencies/lua-5.2/src/luaconf.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/dependencies/lua-5.2/src/luaconf.h?rev=28595&r1=28594&r2=28595&view=diff
==============================================================================
--- branches/S2_5/dependencies/lua-5.2/src/luaconf.h    (original)
+++ branches/S2_5/dependencies/lua-5.2/src/luaconf.h    Sat Mar 21 19:02:16 2015
@@ -1,5 +1,5 @@
 /*
-** $Id: luaconf.h,v 1.176.1.1 2013/04/12 18:48:47 roberto Exp $
+** $Id: luaconf.h,v 1.176.1.2 2013/11/21 17:26:16 roberto Exp $
 ** Configuration file for Lua
 ** See Copyright Notice in lua.h
 */
@@ -325,7 +325,7 @@
 
 
 /*
-@@ LUA_INT32 is an signed integer with exactly 32 bits.
+@@ LUA_INT32 is a signed integer with exactly 32 bits.
 @@ LUAI_UMEM is an unsigned integer big enough to count the total
 @* memory used by Lua.
 @@ LUAI_MEM is a signed integer big enough to count the total memory
@@ -349,7 +349,7 @@
 /*
 @@ LUAI_MAXSTACK limits the size of the Lua stack.
 ** CHANGE it if you need a different limit. This limit is arbitrary;
-** its only purpose is to stop Lua to consume unlimited stack
+** its only purpose is to stop Lua from consuming unlimited stack
 ** space (and to reserve some numbers for pseudo-indices).
 */
 #if LUAI_BITSINT >= 32


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to