summaryrefslogtreecommitdiff
path: root/run.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-04-14 15:51:33 +0200
committerKarl Williamson <public@khwilliamson.com>2013-05-09 08:49:41 -0600
commit47c9d59fcd27684d94480b806b8b6e001aac91cc (patch)
tree0d1d8053a6c41f471d366c40344ff28f072313e4 /run.c
parentd16360cf46a05f65d649c1fe5a38802db2c250d4 (diff)
downloadperl-47c9d59fcd27684d94480b806b8b6e001aac91cc.tar.gz
Remove PERL_ASYNC_CHECK() from Perl_leave_scope().
PERL_ASYNC_CHECK() was added to Perl_leave_scope() as part of commit f410a2119920dd04, which moved signal dispatch from the runloop to control flow ops, to mitigate nearly all of the speed cost of safe signals. The assumption was that scope exit was a safe place to dispatch signals. However, this is not true, as parts of the regex engine call leave_scope(), the regex engine stores some state in per-interpreter variables, and code called within signal handlers can change these values. Hence remove the call to PERL_ASYNC_CHECK() from Perl_leave_scope(), and add it explicitly in the various OPs which were relying on their call to leave_scope() to dispatch any pending signals. Also add a PERL_ASYNC_CHECK() to the exit of the runloop, which ensures signals still dispatch from S_sortcv() and S_sortcv_stacked(), as well as addressing one of the concerns in the commit message of f410a2119920dd04: Subtle bugs might remain - there might be constructions that enter the runloop (where signals used to be dispatched) but don't contain any PERL_ASYNC_CHECK() calls themselves. Finally, move the PERL_ASYNC_CHECK(); added by that commit to pp_goto to the end of the function, to be consistent with the positioning of all other PERL_ASYNC_CHECK() calls - at the beginning or end of OP functions, hence just before the return to or just after the call from the runloop, and hence effectively at the same point as the previous location of PERL_ASYNC_CHECK() in the runloop.
Diffstat (limited to 'run.c')
-rw-r--r--run.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/run.c b/run.c
index 01b5f069f9..ff3bc93a25 100644
--- a/run.c
+++ b/run.c
@@ -42,6 +42,7 @@ Perl_runops_standard(pTHX)
while ((PL_op = op = op->op_ppaddr(aTHX))) {
OP_ENTRY_PROBE(OP_NAME(op));
}
+ PERL_ASYNC_CHECK();
TAINT_NOT;
return 0;