From 1ca8378051227d70700d9f754d22e1bbde2924ad Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 29 May 2002 14:28:05 +0000 Subject: 17250: dont't execsave()/execrestore() around synchronous traps --- Src/signals.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/signals.c b/Src/signals.c index fc8705f4f..8b1b9775c 100644 --- a/Src/signals.c +++ b/Src/signals.c @@ -945,7 +945,16 @@ dotrapargs(int sig, int *sigtr, void *sigfn) *sigtr |= ZSIG_IGNORED; lexsave(); - execsave(); + if (sig != SIGEXIT && sig != SIGDEBUG) { + /* + * SIGEXIT and SIGDEBUG are always run synchronously, so we don't + * need to save and restore the state. + * + * Do we actually need this at all now we queue signals + * for handling in places where they won't cause trouble? + */ + execsave(); + } breaks = 0; runhookdef(BEFORETRAPHOOK, NULL); if (*sigtr & ZSIG_FUNC) { @@ -972,7 +981,8 @@ dotrapargs(int sig, int *sigtr, void *sigfn) trapret = trapreturn; else if (errflag) trapret = 1; - execrestore(); + if (sig != SIGEXIT && sig != SIGDEBUG) + execrestore(); lexrestore(); if (trapret > 0) { -- cgit 1.4.1