mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 17:20:25 +02:00
40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant.
This commit is contained in:
parent
0672c75359
commit
e51c9c17af
13 changed files with 126 additions and 42 deletions
|
|
@ -295,6 +295,8 @@ evalcond(Estate state, char *fromtest)
|
|||
int test, npat = state->pc[1];
|
||||
Patprog pprog = state->prog->pats[npat];
|
||||
|
||||
queue_signals();
|
||||
|
||||
if (pprog == dummy_patprog1 || pprog == dummy_patprog2) {
|
||||
char *opat;
|
||||
int save;
|
||||
|
|
@ -308,6 +310,7 @@ evalcond(Estate state, char *fromtest)
|
|||
if (!(pprog = patcompile(right, (save ? PAT_ZDUP : PAT_STATIC),
|
||||
NULL))) {
|
||||
zwarnnam(fromtest, "bad pattern: %s", right);
|
||||
unqueue_signals();
|
||||
return 2;
|
||||
}
|
||||
else if (save)
|
||||
|
|
@ -316,6 +319,8 @@ evalcond(Estate state, char *fromtest)
|
|||
state->pc += 2;
|
||||
test = (pprog && pattry(pprog, left));
|
||||
|
||||
unqueue_signals();
|
||||
|
||||
return !(ctype == COND_STRNEQ ? !test : test);
|
||||
}
|
||||
case COND_STRLT:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue