diff options
author | Yves Orton <demerphq@gmail.com> | 2022-09-25 10:50:00 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-20 11:34:22 +0800 |
commit | 8a8491416c79dc8f491c402c013844437c0643eb (patch) | |
tree | b00577962633b21c95891ca90d5c2ab15faea431 /embed.h | |
parent | 828bae551a7fc07a99c6bf42fdae003f7929d080 (diff) | |
download | perl-8a8491416c79dc8f491c402c013844437c0643eb.tar.gz |
toke.c - invoke __DIE__ handler after compilation errors in eval
Currently whether the __DIE__ signal handler triggers during compilation
of an eval string depends on the selection of the errors it contains.
Certain types of compilation error are considered "deferred errors" and
will not terminate compilation immediately, for instance undeclared
variables do not confuse the compiler so they do not trigger immediate
termination, and we will report them without limit provided they are the
only errors encountered. Whether a given error terminates compilation or
not or uses the error count to decide to do so seems to be somewhat
random, and it is quite possible that compilation can complete, with
errors, without ever "throwing" the exception so it can be passed to the
__DIE__ handler.
This patch ensures that when the eval has failed due to errors the
$SIG{__DIE__} handler is invoked before the eval completes.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1491,6 +1491,9 @@ # define doopen_pm(a) S_doopen_pm(aTHX_ a) # endif /* !defined(PERL_DISABLE_PMC) */ # endif /* defined(PERL_IN_PP_CTL_C) */ +# if defined(PERL_IN_PP_CTL_C) || defined(PERL_IN_UTIL_C) +# define invoke_exception_hook(a,b) Perl_invoke_exception_hook(aTHX_ a,b) +# endif /* defined(PERL_IN_PP_CTL_C) || defined(PERL_IN_UTIL_C) */ # if defined(PERL_IN_PP_HOT_C) # define do_oddball(a,b) S_do_oddball(aTHX_ a,b) # define opmethod_stash(a) S_opmethod_stash(aTHX_ a) @@ -1622,7 +1625,6 @@ # endif /* defined(PERL_IN_UTF8_C) */ # if defined(PERL_IN_UTIL_C) # define ckwarn_common(a) S_ckwarn_common(aTHX_ a) -# define invoke_exception_hook(a,b) S_invoke_exception_hook(aTHX_ a,b) # define mess_alloc() S_mess_alloc(aTHX) # define with_queued_errors(a) S_with_queued_errors(aTHX_ a) # if defined(PERL_MEM_LOG) && !defined(PERL_MEM_LOG_NOIMPL) |