summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-02-20 05:30:54 +0100
committerYves Orton <demerphq@gmail.com>2023-02-20 16:16:14 +0800
commit0a73ee9e231197058947bf0a854703757dc357ac (patch)
tree911c2d75f1915ab242731a5b7127c4bafc5623b6
parent248b96b9665b816ea8d1c3415b674dabccf7190b (diff)
downloadperl-0a73ee9e231197058947bf0a854703757dc357ac.tar.gz
perldelta.pod - document $SIG{__DIE__} and compile error count bugfixes
We have fixed bugs related to $SIG{__DIE__} being inconsistently triggered during eval, and we have fixed bugs with compilation inconsistently stopping after 10 errors. This patch also includes a micro-tweak to perl.h to allow the threshold to be sanely overriden in Configure.
-rw-r--r--perl.h2
-rw-r--r--pod/perldelta.pod29
2 files changed, 31 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 4ad758265a..11e13be84c 100644
--- a/perl.h
+++ b/perl.h
@@ -9092,7 +9092,9 @@ END_EXTERN_C
#define PERL_DIAG_WARN_SYNTAX(x) PERL_DIAG_STR_(x)
#define PERL_DIAG_DIE_SYNTAX(x) PERL_DIAG_STR_(x)
+#ifndef PERL_STOP_PARSING_AFTER_N_ERRORS
#define PERL_STOP_PARSING_AFTER_N_ERRORS 10
+#endif
#define PERL_PARSE_ERROR_COUNT(f) (f)
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index d48431a53a..340766c989 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -438,6 +438,35 @@ would not be resolved by C<AUTOLOAD>, while it was in 5.36. The
C<INCDIR> method for objects in C<@INC> cannot be resolved by
C<AUTOLOAD> as C<INC> would have been resolved first. [github #20665]
+=item *
+
+C<$SIG{__DIE__}> will now be called from eval when the code dies during
+compilation regardless of how it dies. This means that code expecting to
+be able to upgrade C<$@> into an object will be called consistently. In
+earlier versions of perl C<$SIG{__DIE__}> would not be called for
+certain compilation errors, for instance undeclared variables. For other
+errors it might be called if there were more than a certain number of
+errors, but not if there were less. Now you can expect that it will be
+called in every case.
+
+=item *
+
+Compilation of code with errors used to inconsistently stop depending on
+the count and type of errors encountered. The intent was that after 10
+errors compilation would halt, but bugs in this logic meant that certain
+types of error would be counted, but would not trigger the threshold
+check to stop compilation. Other errors would. With this release after
+at most 10 errors compilation will terminate, regardless of what type of
+error they were.
+
+Note that you can change the maximum count by defining
+C<PERL_STOP_PARSING_AFTER_N_ERRORS> to be something else during the
+configuration process. For instance
+
+ ./Configure ... -Accflags='-DPERL_STOP_PARSING_AFTER_N_ERRORS=100'
+
+would allow up to 100 errors.
+
=back
=head1 Known Problems