mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Update liblua to Lua 5.3.4
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lparser.c,v 2.153 2016/05/13 19:10:16 roberto Exp $
|
||||
** $Id: lparser.c,v 2.155 2016/08/01 19:51:24 roberto Exp $
|
||||
** Lua Parser
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -323,6 +323,8 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
|
||||
luaK_nil(fs, reg, extra);
|
||||
}
|
||||
}
|
||||
if (nexps > nvars)
|
||||
ls->fs->freereg -= nexps - nvars; /* remove extra values */
|
||||
}
|
||||
|
||||
|
||||
@@ -764,7 +766,7 @@ static void parlist (LexState *ls) {
|
||||
}
|
||||
case TK_DOTS: { /* param -> '...' */
|
||||
luaX_next(ls);
|
||||
f->is_vararg = 2; /* declared vararg */
|
||||
f->is_vararg = 1; /* declared vararg */
|
||||
break;
|
||||
}
|
||||
default: luaX_syntaxerror(ls, "<name> or '...' expected");
|
||||
@@ -960,7 +962,6 @@ static void simpleexp (LexState *ls, expdesc *v) {
|
||||
FuncState *fs = ls->fs;
|
||||
check_condition(ls, fs->f->is_vararg,
|
||||
"cannot use '...' outside a vararg function");
|
||||
fs->f->is_vararg = 1; /* function actually uses vararg */
|
||||
init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0));
|
||||
break;
|
||||
}
|
||||
@@ -1160,11 +1161,8 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
|
||||
int nexps;
|
||||
checknext(ls, '=');
|
||||
nexps = explist(ls, &e);
|
||||
if (nexps != nvars) {
|
||||
if (nexps != nvars)
|
||||
adjust_assign(ls, nvars, nexps, &e);
|
||||
if (nexps > nvars)
|
||||
ls->fs->freereg -= nexps - nvars; /* remove extra values */
|
||||
}
|
||||
else {
|
||||
luaK_setoneret(ls->fs, &e); /* close last expression */
|
||||
luaK_storevar(ls->fs, &lh->v, &e);
|
||||
@@ -1615,7 +1613,7 @@ static void mainfunc (LexState *ls, FuncState *fs) {
|
||||
BlockCnt bl;
|
||||
expdesc v;
|
||||
open_func(ls, fs, &bl);
|
||||
fs->f->is_vararg = 2; /* main function is always declared vararg */
|
||||
fs->f->is_vararg = 1; /* main function is always declared vararg */
|
||||
init_exp(&v, VLOCAL, 0); /* create and... */
|
||||
newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */
|
||||
luaX_next(ls); /* read first token */
|
||||
|
||||
Reference in New Issue
Block a user