Add a failing test for stack corruption with MULTICALL
Alex Vandiver [Wed, 4 Mar 2009 07:54:26 +0000 (02:54 -0500)]
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";
+}