From: SADAHIRO Tomoyuki Date: Tue, 8 Nov 2005 23:36:13 +0000 (+0900) Subject: Re: A surprising segfault X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1937c63eabbbeefba39986529a3c98e62f3dcab4;p=p5sagit%2Fp5-mst-13.2.git Re: A surprising segfault Message-Id: <20051108233535.735D.BQW10602@nifty.com> p4raw-id: //depot/perl@26045 --- diff --git a/t/io/fs.t b/t/io/fs.t index 14b452e..63b5efe 100755 --- a/t/io/fs.t +++ b/t/io/fs.t @@ -49,7 +49,7 @@ $needs_fh_reopen = 1 if (defined &Win32::IsWin95 && Win32::IsWin95()); my $skip_mode_checks = $^O eq 'cygwin' && $ENV{CYGWIN} !~ /ntsec/; -plan tests => 49; +plan tests => 51; if (($^O eq 'MSWin32') || ($^O eq 'NetWare')) { @@ -439,5 +439,16 @@ else { ok(-d 'tmp1', "rename on directories working"); +{ + # Change 26011: Re: A surprising segfault + # to make sure only that these obfuscated sentences will not crash. + + map chmod(+()), ('')x68; + ok(1, "extend sp in pp_chmod"); + + map chown(+()), ('')x68; + ok(1, "extend sp in pp_chown"); +} + # need to remove 'tmp' if rename() in test 28 failed! END { rmdir 'tmp1'; rmdir 'tmp'; 1 while unlink "Iofs.tmp"; } diff --git a/t/io/print.t b/t/io/print.t index 2685b0a..d29036b 100755 --- a/t/io/print.t +++ b/t/io/print.t @@ -9,7 +9,7 @@ use strict 'vars'; eval 'use Errno'; die $@ if $@ and !$ENV{PERL_CORE_MINITEST}; -print "1..19\n"; +print "1..21\n"; my $foo = 'STDOUT'; print $foo "ok 1\n"; @@ -53,3 +53,15 @@ if (!exists &Errno::EBADF) { print "not " if ($! != &Errno::EBADF); print "ok 19\n"; } + +{ + # Change 26009: pp_print didn't extend the stack + # before pushing its return value + # to make sure only that these obfuscated sentences will not crash. + + map print(reverse), ('')x68; + print "ok 20\n"; + + map print(+()), ('')x68; + print "ok 21\n"; +} diff --git a/t/op/chop.t b/t/op/chop.t index a77ff30..b0308b0 100755 --- a/t/op/chop.t +++ b/t/op/chop.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 137; +plan tests => 139; $_ = 'abc'; $c = do foo(); @@ -232,3 +232,14 @@ foreach my $start (@chars) { is($asc, "perl", "chopped ascii NUL"); is($utf, "perl", "chopped utf8 NUL"); } + +{ + # Change 26011: Re: A surprising segfault + # to make sure only that these obfuscated sentences will not crash. + + map chop(+()), ('')x68; + ok(1, "extend sp in pp_chop"); + + map chomp(+()), ('')x68; + ok(1, "extend sp in pp_chomp"); +} diff --git a/t/op/sort.t b/t/op/sort.t index 42ef5f3..c328b6e 100755 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -14,6 +14,9 @@ print "1..143\n"; sort { while(1) {} } @a; sort { while(1) { last; } } @a; sort { while(0) { last; } } @a; + + # Change 26011: Re: A surprising segfault + map scalar(sort(+())), ('')x68; } sub Backwards { $a lt $b ? 1 : $a gt $b ? -1 : 0 }