1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-05 11:01:13 +02:00

45083: Add signal protection to execarith().

Otherwise we could get re-entrancy in memory functions when
setting variables.
This commit is contained in:
Peter Stephenson 2019-12-18 10:51:59 +00:00
parent a90e93f454
commit fd068221b7
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2019-12-18 Peter Stephenson <p.stephenson@samsung.com>
* 45083: Src/exec.c: execarith() needs signal protection as
it sets variables.
2019-12-18 Daniel Shahaf <danielsh@apache.org> 2019-12-18 Daniel Shahaf <danielsh@apache.org>
* 45076: Src/loop.c: internal: Simplify handling of * 45076: Src/loop.c: internal: Simplify handling of

View file

@ -5101,6 +5101,7 @@ execarith(Estate state, UNUSED(int do_exec))
mnumber val = zero_mnumber; mnumber val = zero_mnumber;
int htok = 0; int htok = 0;
queue_signals();
if (isset(XTRACE)) { if (isset(XTRACE)) {
printprompt4(); printprompt4();
fprintf(xtrerr, "(("); fprintf(xtrerr, "((");
@ -5120,6 +5121,8 @@ execarith(Estate state, UNUSED(int do_exec))
fprintf(xtrerr, " ))\n"); fprintf(xtrerr, " ))\n");
fflush(xtrerr); fflush(xtrerr);
} }
unqueue_signals();
if (errflag) { if (errflag) {
errflag &= ~ERRFLAG_ERROR; errflag &= ~ERRFLAG_ERROR;
return 2; return 2;