diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-03-18 19:57:49 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-03-22 02:23:53 +0000 |
commit | a3c6c5513dcfc25d952735449bf6da476d905184 (patch) | |
tree | 834103012b6a2675b08c9fdfef779c18690cdb9b | |
parent | fd1ef7d770d285dbf12f4b3516ea963a852e5cdd (diff) | |
download | zsh-a3c6c5513dcfc25d952735449bf6da476d905184.tar.gz zsh-a3c6c5513dcfc25d952735449bf6da476d905184.tar.xz zsh-a3c6c5513dcfc25d952735449bf6da476d905184.zip |
45583/0007: WC_FUNCDEF: Add a placeholder element.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Config/version.mk | 4 | ||||
-rw-r--r-- | Src/exec.c | 3 | ||||
-rw-r--r-- | Src/parse.c | 5 | ||||
-rw-r--r-- | Src/text.c | 2 |
5 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index 6d40cc049..fe4102045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-03-22 Daniel Shahaf <d.s@daniel.shahaf.name> + * 45583/0007: Config/version.mk, Src/exec.c, Src/parse.c, + Src/text.c: WC_FUNCDEF: Add a placeholder element. + * 45583/0006: Src/parse.c: internal: Add some comments for orientation. No functional change. diff --git a/Config/version.mk b/Config/version.mk index 6540e4b98..7ecfd35ba 100644 --- a/Config/version.mk +++ b/Config/version.mk @@ -27,5 +27,5 @@ # This must also serve as a shell script, so do not add spaces around the # `=' signs. -VERSION=5.8.0.1-dev -VERSION_DATE='February 15, 2020' +VERSION=5.8.0.2-dev +VERSION_DATE='March 19, 2020' diff --git a/Src/exec.c b/Src/exec.c index cd014ff38..3c3fcfa3e 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -5169,6 +5169,7 @@ execfuncdef(Estate state, Eprog redir_prog) sbeg = *state->pc++; nstrs = *state->pc++; npats = *state->pc++; + (void) *state->pc++; nprg = (end - state->pc); plen = nprg * sizeof(wordcode); @@ -6138,7 +6139,7 @@ stripkshdef(Eprog prog, char *name) int sbeg = pc[2], nstrs = pc[3], nprg, npats = pc[4], plen, len, i; Patprog *pp; - pc += 5; + pc += 6; nprg = end - pc; plen = nprg * sizeof(wordcode); diff --git a/Src/parse.c b/Src/parse.c index 6ca6f33be..0111c25b6 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -173,6 +173,7 @@ struct heredocs *hdocs; * - followed by offset to first string * - followed by length of string table * - followed by number of patterns for body + * - followed by a placeholder * - followed by codes for body * - followed by strings for body * - if number of names is 0, followed by: @@ -1691,6 +1692,7 @@ par_funcdef(int *cmplx) ecadd(0); /* p + num + 2 */ ecadd(0); /* p + num + 3 */ ecadd(0); /* p + num + 4 */ + ecadd(0); /* p + num + 5 */ nocorrect = 0; incmdpos = 1; @@ -1730,6 +1732,7 @@ par_funcdef(int *cmplx) ecbuf[p + num + 2] = so - oecssub; ecbuf[p + num + 3] = ecsoffs - so; /* "length of string table" */ ecbuf[p + num + 4] = ecnpats; /* "number of patterns for body" */ + ecbuf[p + num + 5] = 0; ecbuf[p + 1] = num; /* "number of names" */ ecnpats = onp; @@ -2053,6 +2056,7 @@ par_simple(int *cmplx, int nr) ecadd(0); ecadd(0); ecadd(0); + ecadd(0); ecnfunc++; ecssub = so = ecsoffs; @@ -2108,6 +2112,7 @@ par_simple(int *cmplx, int nr) ecbuf[p + argc + 2] = so - oecssub; ecbuf[p + argc + 3] = ecsoffs - so; ecbuf[p + argc + 4] = ecnpats; + ecbuf[p + argc + 5] = 0; ecnpats = onp; ecssub = oecssub; diff --git a/Src/text.c b/Src/text.c index 69530ae79..4bf88f2e2 100644 --- a/Src/text.c +++ b/Src/text.c @@ -600,7 +600,7 @@ gettext2(Estate state) n->u._funcdef.end = end; n->u._funcdef.nargs = nargs; state->strs += *state->pc; - state->pc += 3; + state->pc += 4; } } else { state->strs = s->u._funcdef.strs; |