search for: funcline

Displaying 9 results from an estimated 9 matches for "funcline".

Did you mean: finline
2020 Mar 28
0
[klibc:update-dash] dash: eval: avoid leaking memory associated with redirections
...exit: exraise(EXEXIT); } + popstackmark(&smark); + return exitstatus; } @@ -396,14 +402,12 @@ evalfor(union node *n, int flags) struct arglist arglist; union node *argp; struct strlist *sp; - struct stackmark smark; int status; errlinno = lineno = n->nfor.linno; if (funcline) lineno -= funcline - 1; - setstackmark(&smark); arglist.lastp = &arglist.list; for (argp = n->nfor.args ; argp ; argp = argp->narg.next) { expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); @@ -420,7 +424,6 @@ evalfor(union node *n, int flags) break; } loopnest-...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Do not allow break to break across function calls
...al.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index ccd5e0c0..204f1e57 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -928,9 +928,11 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) struct jmploc jmploc; int e; int savefuncline; + int saveloopnest; saveparam = shellparam; savefuncline = funcline; + saveloopnest = loopnest; savehandler = handler; if ((e = setjmp(jmploc.loc))) { goto funcdone; @@ -940,6 +942,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) shellparam.malloc = 0; func-&g...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Do not allow break to break across function calls
...al.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 1c76d4c5..e0c21f94 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -928,9 +928,11 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) struct jmploc jmploc; int e; int savefuncline; + int saveloopnest; saveparam = shellparam; savefuncline = funcline; + saveloopnest = loopnest; savehandler = handler; if ((e = setjmp(jmploc.loc))) { goto funcdone; @@ -940,6 +942,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) shellparam.malloc = 0; func-&g...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...flags) break; #endif case NNOT: - evaltree(n->nnot.com, EV_TESTED); - status = !exitstatus; + status = !evaltree(n->nnot.com, EV_TESTED); goto setstatus; case NREDIR: errlinno = lineno = n->nredir.linno; @@ -230,11 +231,8 @@ evaltree(union node *n, int flags) lineno -= funcline - 1; expredir(n->nredir.redirect); pushredir(n->nredir.redirect); - status = redirectsafe(n->nredir.redirect, REDIR_PUSH); - if (!status) { - evaltree(n->nredir.n, flags & EV_TESTED); - status = exitstatus; - } + status = redirectsafe(n->nredir.redirect, REDIR_PUSH)...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...flags) break; #endif case NNOT: - evaltree(n->nnot.com, EV_TESTED); - status = !exitstatus; + status = !evaltree(n->nnot.com, EV_TESTED); goto setstatus; case NREDIR: errlinno = lineno = n->nredir.linno; @@ -230,11 +231,8 @@ evaltree(union node *n, int flags) lineno -= funcline - 1; expredir(n->nredir.redirect); pushredir(n->nredir.redirect); - status = redirectsafe(n->nredir.redirect, REDIR_PUSH); - if (!status) { - evaltree(n->nredir.n, flags & EV_TESTED); - status = exitstatus; - } + status = redirectsafe(n->nredir.redirect, REDIR_PUSH)...
2012 Jul 02
0
[klibc:master] [BUILTIN] Merge SKIPFUNC/ SKIPFILE and only clear SKIPFUNC when leaving dotcmd
...+), 3 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 8dc84ce..ae83508 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -1043,7 +1043,7 @@ returncmd(int argc, char **argv) * If called outside a function, do what ksh does; * skip the rest of the file. */ - evalskip = funcline ? SKIPFUNC : SKIPFILE; + evalskip = SKIPFUNC; return argv[1] ? number(argv[1]) : exitstatus; } diff --git a/usr/dash/eval.h b/usr/dash/eval.h index ac394e8..5ccfa9f 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -57,4 +57,3 @@ extern int evalskip; #define SKIPBREAK (1 << 0) #def...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Exit without arguments in a trap should use status outside traps
...val.h | 1 + usr/dash/main.c | 11 +++++++++-- usr/dash/trap.c | 25 ++++++++++++++----------- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index b384cb82..ccd5e0c0 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -74,6 +74,7 @@ static int funcline; /* starting line number of current function, or 0 if not i char *commandname; int exitstatus; /* exit status of last command */ int back_exitstatus; /* exit status of backquoted command */ +int savestatus = -1; /* exit status of last command outside traps */ #if !defined(__alpha__) ||...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Exit without arguments in a trap should use status outside traps
...val.h | 1 + usr/dash/main.c | 11 +++++++++-- usr/dash/trap.c | 25 ++++++++++++++----------- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/usr/dash/eval.c b/usr/dash/eval.c index 3e08e825..1c76d4c5 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -74,6 +74,7 @@ static int funcline; /* starting line number of current function, or 0 if not i char *commandname; int exitstatus; /* exit status of last command */ int back_exitstatus; /* exit status of backquoted command */ +int savestatus = -1; /* exit status of last command outside traps */ #if !defined(__alpha__) ||...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...-git a/usr/dash/eval.c b/usr/dash/eval.c index fc5a594a..77a8bded 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -737,6 +737,8 @@ evalcommand(union node *cmd, int flags) int execcmd; int status; char **nargv; + int 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,...