diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 06:59:57 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 06:59:57 +0000 |
commit | 959e367355e7dca571e3848d9993f40c66a84fd5 (patch) | |
tree | 2cdafaf45978c4665a8f0917f4709ae5e5653f35 /t | |
parent | 24ef60581ee187bb6d4388e124dfc34b8cf0b663 (diff) | |
download | perl-959e367355e7dca571e3848d9993f40c66a84fd5.tar.gz |
the premature FREETMPS calls in change#1187 weren't defensive enough
p4raw-link: @1187 on //depot/perl: a29cdaf07aa5601e42ae4955cc0f168e91a7c385
p4raw-id: //depot/perl@5699
Diffstat (limited to 't')
-rwxr-xr-x | t/op/recurse.t | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/t/op/recurse.t b/t/op/recurse.t index 6594940a90..dc823ed966 100755 --- a/t/op/recurse.t +++ b/t/op/recurse.t @@ -4,7 +4,7 @@ # test recursive functions. # -print "1..23\n"; +print "1..25\n"; sub gcd ($$) { return gcd($_[0] - $_[1], $_[1]) if ($_[0] > $_[1]); @@ -84,3 +84,33 @@ for $x (0..3) { print 'not ' unless (($t = takeuchi($x, $y, $z)) == $z + 1); print "ok ", $i++, "\n"; print "# takeuchi($x, $y, $z) = $t\n"; + +{ + sub get_first1 { + get_list1(@_)->[0]; + } + + sub get_list1 { + return [24] unless $_[0]; + my $u = get_first1(0); + [$u]; + } + my $x = get_first1(1); + print "ok $x\n"; +} + +{ + sub get_first2 { + return get_list2(@_)->[0]; + } + + sub get_list2 { + return [25] unless $_[0]; + my $u = get_first2(0); + return [$u]; + } + my $x = get_first2(1); + print "ok $x\n"; +} + +$i = 26; |