summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2017-08-24 15:52:33 +1000
committerSteve Hay <steve.m.hay@googlemail.com>2018-03-02 19:54:14 +0000
commit7b86aed2b751355de4d811ef73c8edec03b15fbb (patch)
tree065d81fd3525763c39ebaf965e96ce815f12a3f4 /t
parentab5bbd91192c7f049cd8031831ed308f58dd79ee (diff)
downloadperl-7b86aed2b751355de4d811ef73c8edec03b15fbb.tar.gz
(perl #131954) don't initialize mark before a possible move of the stack
(cherry picked from commit 57bd660029d94312ca4eb88993889d981f41b484)
Diffstat (limited to 't')
-rw-r--r--t/op/list.t42
1 files changed, 41 insertions, 1 deletions
diff --git a/t/op/list.t b/t/op/list.t
index 3f9487b96f..2acb03a321 100644
--- a/t/op/list.t
+++ b/t/op/list.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc(qw(. ../lib));
}
-plan( tests => 71 );
+plan( tests => 72 );
@foo = (1, 2, 3, 4);
cmp_ok($foo[0], '==', 1, 'first elem');
@@ -228,3 +228,43 @@ ok(($0[()[()]],1), "[perl #126193] list slice with zero indexes");
@x;
pass('no panic'); # panics only under DEBUGGING
}
+
+fresh_perl_is(<<'EOS', "", {}, "[perl #131954] heap use after free in pp_list");
+#!./perl
+BEGIN {
+my $bar = "bar";
+
+sub test_no_error {
+ eval $_[0];
+}
+
+test_no_error($_) for split /\n/,
+q[ x
+ definfoo, $bar;
+ x
+ x
+ x
+ grep((not $bar, $bar, $bar), $bar);
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ ];
+}
+EOS