On Sat, Feb 08, 2003 at 09:05:14PM +0200, Enache Adrian wrote:
> It fixes #20154, #20357, #19061 and passes all tests.

Is there anything wrong with my patch ? I use it myself since
a week and saw no problems so far.
( I agree with Stephen McCamant analyse/conclusion in the 
  redo case, but my solution - pushing the first OP_LEAVESUB,
  still looks fine - I see no other way to force the execution
  of the labeled COP ).

Anyway, here is the sh script turned into a regression script:

#! /usr/bin/perl
require "test.pl";
is ( runperl( prog => '{ goto A; A: print "a" } continue { $s++ }' ),
        'a', 'goto inside /{ } continue { }/ loop');
is ( runperl( prog => '{ $s++ } continue { goto A; A: print "a" }' ),
        'a', 'goto inside /do { } continue { }/ loop');
is ( runperl( prog =>
                'foreach(1) { goto A; A: print "a" } continue { $s++ }' ),
        'a', 'goto inside /foreach () { } continue { }/ loop');
is ( runperl( prog => '
sub a { 
  A: {
    if ($p) {
       redo A; B: print "a"; redo A;
    }
  }
  goto B unless $r++
}
a();print "b"'), 'ab', 'loop label wiped away by goto');

# this works in 5.8.0, it should continue to work
is ( runperl( prog => 'for ($p=1;$p && goto A;$p=0) { A: print "a" }' ),
        'a', 'wierd case of goto and for(;;) loop');
__END__

Regards
Adi

Reply via email to