summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vandiver <alexmv@mit.edu>2009-03-04 02:54:26 -0500
committerAbigail <abigail@abigail.be>2009-03-04 10:32:22 +0100
commit8f42c23d2851857a4516e15c2711e93ce4cfa1cd (patch)
tree684648a5b87ca365e24e38b66c156de2e8d10eb6
parentc59d1bfa1963d67385282b3086f8882458918630 (diff)
downloadperl-8f42c23d2851857a4516e15c2711e93ce4cfa1cd.tar.gz
Add a failing test for stack corruption with MULTICALL
-rw-r--r--ext/List-Util/t/stack-corruption.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/List-Util/t/stack-corruption.t b/ext/List-Util/t/stack-corruption.t
new file mode 100644
index 0000000000..8acbb0fb2c
--- /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";
+}