45083: Add signal protection to execarith().

Otherwise we could get re-entrancy in memory functions when
setting variables.
5.9
Peter Stephenson 4 years ago
parent a90e93f454
commit fd068221b7

@ -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…
Cancel
Save