From 3b6ede1eb926d24942a48374503c2c9240fdd589 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 5 Nov 2023 21:33:45 +0200 Subject: [PATCH 36/36] Apply lua-5.4.6 upstream patch 3 See osdn #48946 Signed-off-by: Marko Lindqvist --- dependencies/lua-5.4/Version.txt | 2 +- dependencies/lua-5.4/src/lparser.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dependencies/lua-5.4/Version.txt b/dependencies/lua-5.4/Version.txt index 5e6065ad1c..9212884257 100644 --- a/dependencies/lua-5.4/Version.txt +++ b/dependencies/lua-5.4/Version.txt @@ -2,7 +2,7 @@ Sources here are from lua-5.4.6 (http://www.lua.org/ftp/lua-5.4.6.tar.gz) Upstream bug fixes from https://www.lua.org/bugs.html applied: -1, 2 +1, 2, 3 Not entire lua distribution directory hierarchy is included here, and some files needed for Freeciv usage have been added. diff --git a/dependencies/lua-5.4/src/lparser.c b/dependencies/lua-5.4/src/lparser.c index b745f236f0..2b888c7cff 100644 --- a/dependencies/lua-5.4/src/lparser.c +++ b/dependencies/lua-5.4/src/lparser.c @@ -1022,10 +1022,11 @@ static int explist (LexState *ls, expdesc *v) { } -static void funcargs (LexState *ls, expdesc *f, int line) { +static void funcargs (LexState *ls, expdesc *f) { FuncState *fs = ls->fs; expdesc args; int base, nparams; + int line = ls->linenumber; switch (ls->t.token) { case '(': { /* funcargs -> '(' [ explist ] ')' */ luaX_next(ls); @@ -1063,8 +1064,8 @@ static void funcargs (LexState *ls, expdesc *f, int line) { } init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); luaK_fixline(fs, line); - fs->freereg = base+1; /* call remove function and arguments and leaves - (unless changed) one result */ + fs->freereg = base+1; /* call removes function and arguments and leaves + one result (unless changed later) */ } @@ -1103,7 +1104,6 @@ static void suffixedexp (LexState *ls, expdesc *v) { /* suffixedexp -> primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ FuncState *fs = ls->fs; - int line = ls->linenumber; primaryexp(ls, v); for (;;) { switch (ls->t.token) { @@ -1123,12 +1123,12 @@ static void suffixedexp (LexState *ls, expdesc *v) { luaX_next(ls); codename(ls, &key); luaK_self(fs, v, &key); - funcargs(ls, v, line); + funcargs(ls, v); break; } case '(': case TK_STRING: case '{': { /* funcargs */ luaK_exp2nextreg(fs, v); - funcargs(ls, v, line); + funcargs(ls, v); break; } default: return; -- 2.42.0