Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 8b4094f7cec90e348a904c43c097c581819711e5 https://github.com/Perl/perl5/commit/8b4094f7cec90e348a904c43c097c581819711e5 Author: Lukas Mai <lukasmai....@gmail.com> Date: 2025-02-12 (Wed, 12 Feb 2025)
Changed paths: M util.c Log Message: ----------- util.c: fix goto &somesub in $SIG{__DIE__} handlers Custom die() handlers via $SIG{__DIE__} are supposed to be disabled during their own execution, so throwing an exception from a $SIG{__DIE__} handler does not recurse indefinitely. This was implemented as a simple !CvDEPTH(cv) check, which basically just verifies that the handler sub is not currently part of the call stack. However, if the handler sub does not return normally, but uses goto &othersub to transfer control to a different subroutine, this check fails: CvDEPTH(cv) will be 0 (since the registered handler is not running anymore), but the $SIG{__DIE__}->() call has not returned yet. (Partial) fix: Locally (or rather temporarily) unset PL_diehook for the duration of the handler call. The reason this is not a full fix is that clearing PL_diehook is not reflected in $SIG{__DIE__}, so any modification of $SIG{__DIE__} including seeming no-ops such as { local $SIG{__DIE__}; } will reinstate PL_diehook. Fixes #14527 (partially). Commit: 490e16b76b37f8f981bad86c6fea4164174e6de2 https://github.com/Perl/perl5/commit/490e16b76b37f8f981bad86c6fea4164174e6de2 Author: Reini Urban <rur...@cpanel.net> Date: 2025-02-12 (Wed, 12 Feb 2025) Changed paths: M MANIFEST A t/op/die_goto.t Log Message: ----------- t/op/die_goto.t: test die handler with goto add testcases for the documented die handler exceptions: ... unless the hook routine itself exits via a "goto &sub", a loop exit, or a "die()". The "__DIE__" handler is explicitly disabled during the call, so that you can die from a "__DIE__" handler. Compare: https://github.com/Perl/perl5/compare/8802b49aecff...490e16b76b37 To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications