Skip to content

Commit 0a73ee9

Browse files
committed
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.
1 parent 248b96b commit 0a73ee9

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

perl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9092,7 +9092,9 @@ END_EXTERN_C
90929092
#define PERL_DIAG_WARN_SYNTAX(x) PERL_DIAG_STR_(x)
90939093
#define PERL_DIAG_DIE_SYNTAX(x) PERL_DIAG_STR_(x)
90949094

9095+
#ifndef PERL_STOP_PARSING_AFTER_N_ERRORS
90959096
#define PERL_STOP_PARSING_AFTER_N_ERRORS 10
9097+
#endif
90969098

90979099
#define PERL_PARSE_ERROR_COUNT(f) (f)
90989100

pod/perldelta.pod

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,35 @@ would not be resolved by C<AUTOLOAD>, while it was in 5.36. The
438438
C<INCDIR> method for objects in C<@INC> cannot be resolved by
439439
C<AUTOLOAD> as C<INC> would have been resolved first. [github #20665]
440440

441+
=item *
442+
443+
C<$SIG{__DIE__}> will now be called from eval when the code dies during
444+
compilation regardless of how it dies. This means that code expecting to
445+
be able to upgrade C<$@> into an object will be called consistently. In
446+
earlier versions of perl C<$SIG{__DIE__}> would not be called for
447+
certain compilation errors, for instance undeclared variables. For other
448+
errors it might be called if there were more than a certain number of
449+
errors, but not if there were less. Now you can expect that it will be
450+
called in every case.
451+
452+
=item *
453+
454+
Compilation of code with errors used to inconsistently stop depending on
455+
the count and type of errors encountered. The intent was that after 10
456+
errors compilation would halt, but bugs in this logic meant that certain
457+
types of error would be counted, but would not trigger the threshold
458+
check to stop compilation. Other errors would. With this release after
459+
at most 10 errors compilation will terminate, regardless of what type of
460+
error they were.
461+
462+
Note that you can change the maximum count by defining
463+
C<PERL_STOP_PARSING_AFTER_N_ERRORS> to be something else during the
464+
configuration process. For instance
465+
466+
./Configure ... -Accflags='-DPERL_STOP_PARSING_AFTER_N_ERRORS=100'
467+
468+
would allow up to 100 errors.
469+
441470
=back
442471

443472
=head1 Known Problems

0 commit comments

Comments
 (0)