From 8f42c23d2851857a4516e15c2711e93ce4cfa1cd Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 4 Mar 2009 02:54:26 -0500 Subject: [PATCH] Add a failing test for stack corruption with MULTICALL --- ext/List-Util/t/stack-corruption.t | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ext/List-Util/t/stack-corruption.t 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"; +} -- 1.8.3.1