From: Alex Vandiver Date: Wed, 4 Mar 2009 07:54:26 +0000 (-0500) Subject: Add a failing test for stack corruption with MULTICALL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f42c23d2851857a4516e15c2711e93ce4cfa1cd;p=p5sagit%2Fp5-mst-13.2.git Add a failing test for stack corruption with MULTICALL --- diff --git a/ext/List-Util/t/stack-corruption.t b/ext/List-Util/t/stack-corruption.t new file mode 100644 index 0000000..8acbb0f --- /dev/null +++ b/ext/List-Util/t/stack-corruption.t @@ -0,0 +1,26 @@ +#!./perl + +BEGIN { + unless (-d 'blib') { + chdir 't' if -d 't'; + @INC = '../lib'; + require Config; import Config; + keys %Config; # Silence warning + if ($Config{extensions} !~ /\bList\/Util\b/) { + print "1..0 # Skip: List::Util was not built\n"; + exit 0; + } + } +} + +use List::Util qw(reduce); +use Test::More tests => 1; + +my $ret = "original"; +$ret = $ret . broken(); +is($ret, "originalreturn"); + +sub broken { + reduce { return "bogus"; } qw/some thing/; + return "return"; +}