mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 17:24:50 +01:00
45083: Add signal protection to execarith().
Otherwise we could get re-entrancy in memory functions when setting variables.
This commit is contained in:
parent
a90e93f454
commit
fd068221b7
2 changed files with 8 additions and 0 deletions
|
@ -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>
|
||||
|
||||
* 45076: Src/loop.c: internal: Simplify handling of
|
||||
|
|
|
@ -5101,6 +5101,7 @@ execarith(Estate state, UNUSED(int do_exec))
|
|||
mnumber val = zero_mnumber;
|
||||
int htok = 0;
|
||||
|
||||
queue_signals();
|
||||
if (isset(XTRACE)) {
|
||||
printprompt4();
|
||||
fprintf(xtrerr, "((");
|
||||
|
@ -5120,6 +5121,8 @@ execarith(Estate state, UNUSED(int do_exec))
|
|||
fprintf(xtrerr, " ))\n");
|
||||
fflush(xtrerr);
|
||||
}
|
||||
unqueue_signals();
|
||||
|
||||
if (errflag) {
|
||||
errflag &= ~ERRFLAG_ERROR;
|
||||
return 2;
|
||||
|
|
Loading…
Reference in a new issue