summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-03-26 21:53:29 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2017-08-29 08:16:46 +0100
commit5b4a51d7c850b274c4a37452f256afb7cd5013c1 (patch)
tree080bff118e36585668759f280038489a09ebdd2f /proto.h
parent1eeceb7afa64d9fc42a64b6b2cb6fa003639d5d0 (diff)
downloadperl-5b4a51d7c850b274c4a37452f256afb7cd5013c1.tar.gz
set up catchable runloops early enough
The jmpenv frame to catch Perl exceptions is set up lazily, and this used to be a bit too lazy. The flow of control through pp_entereval had a gap where the eval frame was on the context stack but the catcher hadn't been set up, and it was possible for an exception to occur in that gap and be signalled through unwinding, which would thus break. Specifically this occurred if the code being evaluated died in a UNITCHECK block, because doeval_compile() invokes those blocks with no special arrangements for exceptions, whereas it handles compilation/BEGIN exceptions by means that don't unwind. This patch sets up the catcher earlier, before putting the eval frame on the context stack. This change is made to entereval, entertry, and require, the three ops that set up real eval frames. In each case, whereas previously the catcher was interposed last thing before handing off to the following op, the catcher is now set up first thing in the pp function, with docatch() now recursively invoking the pp function. Fixes [perl #105930]. (cherry picked from commit d7e3f70f30811328d2f6ae57e5892deccf64d0b2)
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto.h b/proto.h
index f1d6181b4b..dd938605f8 100644
--- a/proto.h
+++ b/proto.h
@@ -4848,7 +4848,7 @@ STATIC void S_destroy_matcher(pTHX_ PMOP* matcher);
#define PERL_ARGS_ASSERT_DESTROY_MATCHER \
assert(matcher)
STATIC OP* S_do_smartmatch(pTHX_ HV* seen_this, HV* seen_other, const bool copied);
-STATIC OP* S_docatch(pTHX_ OP *o)
+STATIC OP* S_docatch(pTHX_ Perl_ppaddr_t firstpp)
__attribute__warn_unused_result__;
STATIC bool S_doeval_compile(pTHX_ U8 gimme, CV* outside, U32 seq, HV* hh);