diff --git a/lua54.changes b/lua54.changes index 2d25ea5..5a4f2fc 100644 --- a/lua54.changes +++ b/lua54.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 20 11:00:56 UTC 2020 - Callum Farmer + +- Add upstream patches 7 & 8 + ------------------------------------------------------------------- Sat Jul 18 09:51:00 UTC 2020 - Callum Farmer diff --git a/upstream-bugs.patch b/upstream-bugs.patch index dce2f1d..b0e2481 100644 --- a/upstream-bugs.patch +++ b/upstream-bugs.patch @@ -1,5 +1,14 @@ --- a/src/lgc.c +++ b/src/lgc.c +@@ -856,6 +856,8 @@ static void GCTM (lua_State *L) { + if (unlikely(status != LUA_OK)) { /* error while running __gc? */ + luaE_warnerror(L, "__gc metamethod"); + L->top--; /* pops error object */ ++ if (isLua(L->ci)) ++ L->oldpc = L->ci->u.l.savedpc; /* update 'oldpc' */ + } + } + } @@ -1140,7 +1140,7 @@ static void finishgencycle (lua_State *L, global_State *g) { static void youngcollection (lua_State *L, global_State *g) { GCObject **psurvival; /* to point to first non-dead survival object */ @@ -91,6 +100,18 @@ if (trap) { luaD_hookcall(L, ci); L->oldpc = pc + 1; /* next opcode will be seen as a "new" line */ +--- a/src/liolib.c ++++ b/src/liolib.c +@@ -279,6 +279,8 @@ static int io_popen (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + LStream *p = newprefile(L); ++ luaL_argcheck(L, ((mode[0] == 'r' || mode[0] == 'w') && mode[1] == '\0'), ++ 2, "invalid mode"); + p->f = l_popen(L, filename, mode); + p->closef = &io_pclose; + return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; + --- a/src/ldo.h +++ b/src/ldo.h @@ -44,7 +44,7 @@