53732: avoid tail-call exec in always block

This commit is contained in:
Philippe Altherr
2025-10-26 13:39:33 -07:00
committed by Bart Schaefer
parent 5198c44107
commit 477c6890b0
3 changed files with 11 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
2025-10-26 Bart Schaefer <schaefer@zsh.org>
* Philippe: 53732: avoid tail-call exec in always block
2025-10-24 Oliver Kiddle <opk@zsh.org>
* 54002: Src/parse.c: silence compiler warning for static function

View File

@@ -774,7 +774,7 @@ exectry(Estate state, int do_exec)
contflag = 0;
state->pc = always;
execlist(state, 1, do_exec);
execlist(state, 1, 0);
if (try_errflag)
errflag |= ERRFLAG_ERROR;

View File

@@ -720,6 +720,12 @@
>always 1
>try 2
() { { return 2 } always { return 3 } }
2:Exit status of always block is ignored
() { ( { return 2 } always { ( return 3 ) } ) }
2:Regression test for exit status of always block is ignored also in tailcalls
(
mywrap() { echo BEGIN; true; echo END }
mytest() { { exit 3 } always { mywrap }; print Exited before this }