develooper Front page | perl.perl5.porters | Postings from April 2005

[perl #22132] 5.8.0: goto inside any loop causes seg-fault when exiting loop

From:
Steve Peters via RT
Date:
April 23, 2005 06:00
Subject:
[perl #22132] 5.8.0: goto inside any loop causes seg-fault when exiting loop
Message ID:
rt-3.0.11-22132-111293.8.00977956692996@perl.org
> [jmahood - Wed May 07 08:18:05 2003]:
> 
> Under 5.8.0, it seems that any loop (for, while, do while) that
> contains a
> label and a goto causes a segmentation fault when the loop's end
> condition is
> met.
> 
> for ($x=0; $x < 5; $x++) {
>          goto FOO;
>          FOO:
>          print "$x\n";
> }
> 
> ....results in:
> 
> 0
> 1
> 2
> 3
> 4
> Segmentation fault
> 
> .... whereas inserting "last if ($x == 4);" at the end of the loop
> breaks it
> without the seg fault.
> 

I did not get the segmentation fault when testing with Perl 5.8.4, so
I'm guessing this bug was fixed somewhere between 5.8.1 and 5.8.4.



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