This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
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)
committerAbigail <abigail@abigail.be>
Wed, 4 Mar 2009 09:32:22 +0000 (10:32 +0100)
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";
+}