summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-09-25 10:50:00 +0200
committerYves Orton <demerphq@gmail.com>2023-02-20 11:34:22 +0800
commit8a8491416c79dc8f491c402c013844437c0643eb (patch)
treeb00577962633b21c95891ca90d5c2ab15faea431 /util.c
parent828bae551a7fc07a99c6bf42fdae003f7929d080 (diff)
downloadperl-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 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 8590b3a4bc..21abe57d46 100644
--- a/util.c
+++ b/util.c
@@ -1717,8 +1717,8 @@ S_with_queued_errors(pTHX_ SV *ex)
return ex;
}
-STATIC bool
-S_invoke_exception_hook(pTHX_ SV *ex, bool warn)
+bool
+Perl_invoke_exception_hook(pTHX_ SV *ex, bool warn)
{
HV *stash;
GV *gv;