On Sun, Jul 17, 2005 at 09:41:58PM +0100, Dave Mitchell wrote: > +# [perl #36521] goto &foo in warn handler could defeat recursion avoider > + > +{ > + my $r = runperl( > + stderr => 1, > + prog => 'my $d; my $w = sub { return if $d++; warn q(bar)}; > local $SIG{__WARN__} = sub { goto &$w; }; warn q(foo);' > + ); > + like($r, qr/bar/, "goto &foo in warn");
This program does not segfault, it does nothing. 0 ~$ perl5.8.6 -wle 'my $d; my $w = sub { return if $d++; warn q(bar)}; local $SIG{__WARN__} = sub { goto &$w; }; warn q(foo);' 0 ~$ I think the problem is you have code to deliberately avoid the recursion in the subroutine. "return if $d++". Get rid of that and it segfaults. 0 ~$ perl5.8.6 -wle 'my $d; my $w = sub { warn @_}; $SIG{__WARN__} = sub { goto &$w; }; warn q(foo);' Bus error 0 ~$ -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern Don't try the paranormal until you know what's normal. -- "Lords and Ladies" by Terry Prachett