mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 04:40:59 +01:00
21814: error handling for traps in "always" constructs.
This commit is contained in:
parent
c3e8aec759
commit
174ad4a80f
3 changed files with 25 additions and 3 deletions
11
Src/loop.c
11
Src/loop.c
|
|
@ -626,6 +626,10 @@ execcase(Estate state, int do_exec)
|
|||
zlong
|
||||
try_errflag = -1;
|
||||
|
||||
/**/
|
||||
zlong
|
||||
try_tryflag = 0;
|
||||
|
||||
/**/
|
||||
int
|
||||
exectry(Estate state, int do_exec)
|
||||
|
|
@ -633,7 +637,7 @@ exectry(Estate state, int do_exec)
|
|||
Wordcode end, always;
|
||||
int endval;
|
||||
int save_retflag, save_breaks, save_loops, save_contflag;
|
||||
zlong save_try_errflag;
|
||||
zlong save_try_errflag, save_try_tryflag;
|
||||
|
||||
end = state->pc + WC_TRY_SKIP(state->pc[-1]);
|
||||
always = state->pc + 1 + WC_TRY_SKIP(*state->pc);
|
||||
|
|
@ -642,8 +646,13 @@ exectry(Estate state, int do_exec)
|
|||
cmdpush(CS_CURSH);
|
||||
|
||||
/* The :try clause */
|
||||
save_try_tryflag = try_tryflag;
|
||||
try_tryflag = 1;
|
||||
|
||||
execlist(state, 1, do_exec);
|
||||
|
||||
try_tryflag = save_try_tryflag;
|
||||
|
||||
/* Don't record errflag here, may be reset. */
|
||||
endval = lastval;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue