Displaying 6 results from an estimated 6 matches for "pushlocalvars".
2020 Mar 28
0
[klibc:update-dash] dash: eval: Always set localvar_stop
...CommitDate: Sat, 28 Mar 2020 21:42:55 +0000
[klibc] dash: eval: Always set localvar_stop
[ dash commit 42298df5898a62f0df893be3af029d7e981623bd ]
The variable localvar_stop is set iff vlocal is true. gcc doesn't
get this so we get a spurious warning.
This patch fixes this by always calling pushlocalvars with vlocal
and making it only actually do the push if vlocal is non-zero.
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/eval.c | 9 +++------
usr/dash/var.c | 12 +++++++++---
usr/dash/var.h | 2 +-...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...t vflags;
+ int vlocal;
errlinno = lineno = cmd->ncmd.linno;
if (funcline)
@@ -745,7 +747,6 @@ evalcommand(union node *cmd, int flags)
/* First expand the arguments. */
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
setstackmark(&smark);
- localvar_stop = pushlocalvars();
file_stop = parsefile;
back_exitstatus = 0;
@@ -759,6 +760,8 @@ evalcommand(union node *cmd, int flags)
cmd_flag = 0;
execcmd = 0;
spclbltin = -1;
+ vflags = 0;
+ vlocal = 0;
path = NULL;
argc = 0;
@@ -770,6 +773,8 @@ evalcommand(union node *cmd, int flags)
find_command(arg...
2019 Jan 25
0
[klibc:update-dash] eval: Restore input files in evalcommand
...alvar_stop;
+ struct parsefile *file_stop;
struct redirtab *redir_stop;
struct stackmark smark;
union node *argp;
@@ -722,6 +723,7 @@ evalcommand(union node *cmd, int flags)
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
setstackmark(&smark);
localvar_stop = pushlocalvars();
+ file_stop = parsefile;
back_exitstatus = 0;
cmdentry.cmdtype = CMDBUILTIN;
@@ -896,6 +898,7 @@ out:
if (cmd->ncmd.redirect)
popredir(execcmd);
unwindredir(redir_stop);
+ unwindfiles(file_stop);
unwindlocalvars(localvar_stop);
if (lastarg)
/* dsl: I think this is intended...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Restore input files in evalcommand
...alvar_stop;
+ struct parsefile *file_stop;
struct redirtab *redir_stop;
struct stackmark smark;
union node *argp;
@@ -722,6 +723,7 @@ evalcommand(union node *cmd, int flags)
TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
setstackmark(&smark);
localvar_stop = pushlocalvars();
+ file_stop = parsefile;
back_exitstatus = 0;
cmdentry.cmdtype = CMDBUILTIN;
@@ -896,6 +898,7 @@ out:
if (cmd->ncmd.redirect)
popredir(execcmd);
unwindredir(redir_stop);
+ unwindfiles(file_stop);
unwindlocalvars(localvar_stop);
if (lastarg)
/* dsl: I think this is intended...
2019 Jan 25
0
[klibc:update-dash] eval: Variable assignments on functions are no longer persistent
...ise:
break;
case CMDFUNCTION:
- poplocalvars(1);
if (evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
break;
@@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
shellparam.p = argv + 1;
shellparam.optind = 1;
shellparam.optoff = -1;
- pushlocalvars();
evaltree(func->n.ndefun.body, flags & EV_TESTED);
- poplocalvars(0);
funcdone:
INTOFF;
loopnest = saveloopnest;
2020 Mar 28
0
[klibc:update-dash] dash: eval: Variable assignments on functions are no longer persistent
...ise:
break;
case CMDFUNCTION:
- poplocalvars(1);
if (evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
break;
@@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
shellparam.p = argv + 1;
shellparam.optind = 1;
shellparam.optoff = -1;
- pushlocalvars();
evaltree(func->n.ndefun.body, flags & EV_TESTED);
- poplocalvars(0);
funcdone:
INTOFF;
loopnest = saveloopnest;