You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
FixesPerl#14527 (partially).
0 commit comments