Add a failing test for stack corruption with MULTICALL
authorAlex Vandiver <alexmv@mit.edu>
Wed, 4 Mar 2009 07:54:26 +0000 (02:54 -0500)
committerDavid Mitchell <davem@iabyn.com>
Wed, 15 Apr 2009 18:50:01 +0000 (19:50 +0100)
(cherry picked from commit 8f42c23d2851857a4516e15c2711e93ce4cfa1cd)

ext/List-Util/t/stack-corruption.t [new file with mode: 0644]

diff --git a/ext/List-Util/t/stack-corruption.t b/ext/List-Util/t/stack-corruption.t
new file mode 100644 (file)
index 0000000..8acbb0f
--- /dev/null
@@ -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";
+}