diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2003-05-22 11:13:19 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-24 06:42:52 +0000 |
commit | 241416b843acd61d654907e145e85fc482a50be6 (patch) | |
tree | c96cc76278637fbfae6930bd1167a874a602a6d8 /t | |
parent | d1e22115d646ecce137e54c6ce8191dc91d252c4 (diff) | |
download | perl-241416b843acd61d654907e145e85fc482a50be6.tar.gz |
[PATCH #2] Re: [perl #22181] goto undefines my() variables
Date: Thu, 22 May 2003 10:13:19 +0100
Message-ID: <20030522091319.GA4568@fdgroup.com>
Subject: Re: [PATCH #2] Re: [perl #22181] goto undefines my() variables
From: Dave Mitchell <davem@fdgroup.com>
Date: Fri, 23 May 2003 17:09:44 +0100
Message-ID: <20030523160944.GC9194@fdgroup.com>
p4raw-id: //depot/perl@19610
Diffstat (limited to 't')
-rwxr-xr-x | t/op/goto.t | 13 | ||||
-rw-r--r-- | t/run/switchd.t | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/t/op/goto.t b/t/op/goto.t index 5b30dc5f41..8a39d9a60c 100755 --- a/t/op/goto.t +++ b/t/op/goto.t @@ -2,7 +2,7 @@ # "This IS structured code. It's just randomly structured." -print "1..28\n"; +print "1..29\n"; while ($?) { $foo = 1; @@ -185,6 +185,17 @@ sub f1 { } f1(); +# bug #22181 - this used to coredump or make $x undefined, due to +# erroneous popping of the inner BLOCK context + +for ($i=0; $i<2; $i++) { + my $x = 1; + goto LABEL29; + LABEL29: + print "not " if !defined $x || $x != 1; +} +print "ok 29 - goto in for(;;) with continuation\n"; + exit; bypass: diff --git a/t/run/switchd.t b/t/run/switchd.t index 91efbef211..160ea9970d 100644 --- a/t/run/switchd.t +++ b/t/run/switchd.t @@ -35,6 +35,6 @@ __SWDTEST__ switches => [ '-Ilib', '-d:switchd' ], progfile => $filename, ); - like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;$/i); + like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;$/i); } |