develooper Front page | perl.perl5.porters | Postings from October 1999

Re: deprecating SIGDIE

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
October 1, 1999 02:27
Subject:
Re: deprecating SIGDIE
Message ID:
199910010926.KAA10747@tiuk.ti.com
Graham Barr <gbarr@pobox.com> writes:
>On Thu, Sep 30, 1999 at 07:32:09AM -0600, Tom Christiansen wrote:
>> The code patch to restore $SIG{__DIE__} to its intended behaviour
>> is trivial:
>
>> -    if (PL_diehook) {
>> +    /*
>> +     * Added test so that a die hook only triggers
>> +     * if the exception is uncaught.  tchrist 30/Sept/99
>> +     */
>> +    if (PL_diehook && !was_in_eval) {
>
>I am not sure this is the right fix. This would effectivly
>make it SIG{__EXIT_ON_DIE__}. 

I think the fix is fine. It just pretends there was no handler.

>
>IMO, eval should just do the local($SIG{__DIE__})

Tom's patch does that by re-using the 'was_in_eval' flag to fake 
a local $SIG{__DIE__} = undef; but more cheaply.

My only concern how 'was_in_eval' interracts with stack swapping stuff,
but as it is already used in tail of the function it cannot be too 
far off.

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About