search for: skipbreak

Displaying 5 results from an estimated 5 matches for "skipbreak".

Did you mean: sigbreak
2019 Jan 25
0
[klibc:update-dash] [EVAL] Move common skipcount logic into skiploop
...iff --git a/usr/dash/eval.c b/usr/dash/eval.c index 204f1e57..bb106368 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -339,27 +339,45 @@ void evaltreenr(union node *n, int flags) #endif +static int skiploop(void) +{ + int skip = evalskip; + + switch (skip) { + case 0: + break; + + case SKIPBREAK: + case SKIPCONT: + if (likely(--skipcount <= 0)) { + evalskip = 0; + break; + } + + skip = SKIPBREAK; + break; + } + + return skip; +} + + STATIC void evalloop(union node *n, int flags) { + int skip; int status; loopnest++; status = 0; flags &= EV_TESTED; - for (;;) { +...
2020 Mar 28
0
[klibc:update-dash] dash: [EVAL] Move common skipcount logic into skiploop
...iff --git a/usr/dash/eval.c b/usr/dash/eval.c index e0c21f94..6cc92c19 100644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -339,27 +339,45 @@ void evaltreenr(union node *n, int flags) #endif +static int skiploop(void) +{ + int skip = evalskip; + + switch (skip) { + case 0: + break; + + case SKIPBREAK: + case SKIPCONT: + if (likely(--skipcount <= 0)) { + evalskip = 0; + break; + } + + skip = SKIPBREAK; + break; + } + + return skip; +} + + STATIC void evalloop(union node *n, int flags) { + int skip; int status; loopnest++; status = 0; flags &= EV_TESTED; - for (;;) { +...
2012 Jul 02
0
[klibc:master] [BUILTIN] Merge SKIPFUNC/ SKIPFILE and only clear SKIPFUNC when leaving dotcmd
...e. */ - 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) #define SKIPCONT (1 << 1) #define SKIPFUNC (1 << 2) -#define SKIPFILE (1 << 3) diff --git a/usr/dash/main.c b/usr/dash/main.c index b38dc27..7df3c44 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -242,7 +242,7 @@ cmdloop(int top) skip = evalskip; if...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Return without arguments in a trap should use status outside traps
...us = number(argv[1]); + } else { + skip = SKIPFUNCDEF; + status = exitstatus; + } + evalskip = skip; + + return status; } diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 6e62137a..6e8acdaf 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -62,3 +62,4 @@ extern int evalskip; #define SKIPBREAK (1 << 0) #define SKIPCONT (1 << 1) #define SKIPFUNC (1 << 2) +#define SKIPFUNCDEF (1 << 3) diff --git a/usr/dash/main.c b/usr/dash/main.c index 29a258d3..00c5e00d 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -242,7 +242,7 @@ cmdloop(int top) skip = evalskip;...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Return without arguments in a trap should use status outside traps
...us = number(argv[1]); + } else { + skip = SKIPFUNCDEF; + status = exitstatus; + } + evalskip = skip; + + return status; } diff --git a/usr/dash/eval.h b/usr/dash/eval.h index 6e62137a..6e8acdaf 100644 --- a/usr/dash/eval.h +++ b/usr/dash/eval.h @@ -62,3 +62,4 @@ extern int evalskip; #define SKIPBREAK (1 << 0) #define SKIPCONT (1 << 1) #define SKIPFUNC (1 << 2) +#define SKIPFUNCDEF (1 << 3) diff --git a/usr/dash/main.c b/usr/dash/main.c index 29a258d3..00c5e00d 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -242,7 +242,7 @@ cmdloop(int top) skip = evalskip;...