diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-04-14 15:51:33 +0200 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-05-09 08:49:41 -0600 |
commit | 47c9d59fcd27684d94480b806b8b6e001aac91cc (patch) | |
tree | 0d1d8053a6c41f471d366c40344ff28f072313e4 /scope.c | |
parent | d16360cf46a05f65d649c1fe5a38802db2c250d4 (diff) | |
download | perl-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 'scope.c')
-rw-r--r-- | scope.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -1248,8 +1248,6 @@ Perl_leave_scope(pTHX_ I32 base) } TAINT_set(was); - - PERL_ASYNC_CHECK(); } void |