develooper Front page | perl.perl5.porters | Postings from June 2002

Re: [ID 20020626.003] 5.8.0-RC2 segfault (combination ofDESTROY, goto, delete)

Thread Previous | Thread Next
From:
Elizabeth Mattijsen
Date:
June 26, 2002 06:14
Subject:
Re: [ID 20020626.003] 5.8.0-RC2 segfault (combination ofDESTROY, goto, delete)
Message ID:
4.2.0.58.20020626150529.0316abc0@mickey.dijkmat.nl
At 01:14 AM 6/26/02 +0200, Pixel wrote:
>The following code segfaults:
>
>sub A::DESTROY {
>     my $f = delete $A::list{$_[0]};
>     goto $f;
>}
>
>{
>     my $w;
>     my $b = bless {}, 'A';
>     $A::list{$b} = sub { $w };
>     0;
>}

Doesn't happen on 5.6.0.

Note that removing the $w from the sub does not segfault.  So it has 
something to do with the closure that was created.

Also note that combining the two statements of DESTROY into:

   goto delete $A::list{$_[0]};

also does not segfault.  So it would seem that the creation of the lexicals 
in the DESTROY is interfering with the closure.


Just my 2c worth...


Liz


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