aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-12 13:47:44 +0000
committerRon Yorston <rmy@pobox.com>2019-03-12 13:47:44 +0000
commitfd0e6a01a68047e959ef13f3161ce302b438d2b1 (patch)
treec9f15afd1220835af46ddf8e72c077c80edbf005 /shell
parentdb255bbadf9c6b219b29d06d4958fbd7967eb8b4 (diff)
parent2452247ea33c1c70263bf4cbc11b3170366ff2ea (diff)
downloadbusybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.tar.gz
busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.tar.bz2
busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8ed0f19f3..8daf263dc 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9631,8 +9631,11 @@ evaltree(union node *n, int flags)
9631{ 9631{
9632 int checkexit = 0; 9632 int checkexit = 0;
9633 int (*evalfn)(union node *, int); 9633 int (*evalfn)(union node *, int);
9634 struct stackmark smark;
9634 int status = 0; 9635 int status = 0;
9635 9636
9637 setstackmark(&smark);
9638
9636 if (n == NULL) { 9639 if (n == NULL) {
9637 TRACE(("evaltree(NULL) called\n")); 9640 TRACE(("evaltree(NULL) called\n"));
9638 goto out; 9641 goto out;
@@ -9746,6 +9749,7 @@ evaltree(union node *n, int flags)
9746 if (flags & EV_EXIT) 9749 if (flags & EV_EXIT)
9747 raise_exception(EXEXIT); 9750 raise_exception(EXEXIT);
9748 9751
9752 popstackmark(&smark);
9749 TRACE(("leaving evaltree (no interrupts)\n")); 9753 TRACE(("leaving evaltree (no interrupts)\n"));
9750 return exitstatus; 9754 return exitstatus;
9751} 9755}
@@ -9806,14 +9810,12 @@ evalfor(union node *n, int flags)
9806 struct arglist arglist; 9810 struct arglist arglist;
9807 union node *argp; 9811 union node *argp;
9808 struct strlist *sp; 9812 struct strlist *sp;
9809 struct stackmark smark;
9810 int status = 0; 9813 int status = 0;
9811 9814
9812 errlinno = lineno = n->ncase.linno; 9815 errlinno = lineno = n->ncase.linno;
9813 if (funcline) 9816 if (funcline)
9814 lineno -= funcline - 1; 9817 lineno -= funcline - 1;
9815 9818
9816 setstackmark(&smark);
9817 arglist.list = NULL; 9819 arglist.list = NULL;
9818 arglist.lastp = &arglist.list; 9820 arglist.lastp = &arglist.list;
9819 for (argp = n->nfor.args; argp; argp = argp->narg.next) { 9821 for (argp = n->nfor.args; argp; argp = argp->narg.next) {
@@ -9830,7 +9832,6 @@ evalfor(union node *n, int flags)
9830 break; 9832 break;
9831 } 9833 }
9832 loopnest--; 9834 loopnest--;
9833 popstackmark(&smark);
9834 9835
9835 return status; 9836 return status;
9836} 9837}
@@ -9841,14 +9842,12 @@ evalcase(union node *n, int flags)
9841 union node *cp; 9842 union node *cp;
9842 union node *patp; 9843 union node *patp;
9843 struct arglist arglist; 9844 struct arglist arglist;
9844 struct stackmark smark;
9845 int status = 0; 9845 int status = 0;
9846 9846
9847 errlinno = lineno = n->ncase.linno; 9847 errlinno = lineno = n->ncase.linno;
9848 if (funcline) 9848 if (funcline)
9849 lineno -= funcline - 1; 9849 lineno -= funcline - 1;
9850 9850
9851 setstackmark(&smark);
9852 arglist.list = NULL; 9851 arglist.list = NULL;
9853 arglist.lastp = &arglist.list; 9852 arglist.lastp = &arglist.list;
9854 expandarg(n->ncase.expr, &arglist, EXP_TILDE); 9853 expandarg(n->ncase.expr, &arglist, EXP_TILDE);
@@ -9867,8 +9866,6 @@ evalcase(union node *n, int flags)
9867 } 9866 }
9868 } 9867 }
9869 out: 9868 out:
9870 popstackmark(&smark);
9871
9872 return status; 9869 return status;
9873} 9870}
9874 9871
@@ -10590,7 +10587,6 @@ evalcommand(union node *cmd, int flags)
10590 struct localvar_list *localvar_stop; 10587 struct localvar_list *localvar_stop;
10591 struct parsefile *file_stop; 10588 struct parsefile *file_stop;
10592 struct redirtab *redir_stop; 10589 struct redirtab *redir_stop;
10593 struct stackmark smark;
10594 union node *argp; 10590 union node *argp;
10595 struct arglist arglist; 10591 struct arglist arglist;
10596 struct arglist varlist; 10592 struct arglist varlist;
@@ -10615,7 +10611,6 @@ evalcommand(union node *cmd, int flags)
10615 10611
10616 /* First expand the arguments. */ 10612 /* First expand the arguments. */
10617 TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); 10613 TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags));
10618 setstackmark(&smark);
10619 localvar_stop = pushlocalvars(); 10614 localvar_stop = pushlocalvars();
10620 file_stop = g_parsefile; 10615 file_stop = g_parsefile;
10621 back_exitstatus = 0; 10616 back_exitstatus = 0;
@@ -10936,7 +10931,6 @@ evalcommand(union node *cmd, int flags)
10936 */ 10931 */
10937 setvar0("_", lastarg); 10932 setvar0("_", lastarg);
10938 } 10933 }
10939 popstackmark(&smark);
10940 10934
10941 return status; 10935 return status;
10942} 10936}