summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorBo Borgerson <gigabo@gmail.com>2009-11-02 11:25:23 -0600
committerSteve Peters <steve@fisharerojo.org>2009-11-02 11:25:23 -0600
commit2b6765935f5ee68d8093e686b8e292ad5de5a898 (patch)
tree383624ed8bb748573fcffe09f9486f20c4818ace /t
parent2f7a9718549bed20690a376daf82104fa475c252 (diff)
downloadperl-2b6765935f5ee68d8093e686b8e292ad5de5a898.tar.gz
[PATCH] [perl #20321] Non-destructive Perl_av_make
Don't let sv_setsv swipe temps in av_make, since the source array might have multiple references to the same temp scalar (e.g. from a list slice).
Diffstat (limited to 't')
-rw-r--r--t/op/list.t6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/list.t b/t/op/list.t
index a8fdc180b5..184724a3cf 100644
--- a/t/op/list.t
+++ b/t/op/list.t
@@ -6,7 +6,7 @@ BEGIN {
}
require "test.pl";
-plan( tests => 57 );
+plan( tests => 58 );
@foo = (1, 2, 3, 4);
cmp_ok($foo[0], '==', 1, 'first elem');
@@ -161,3 +161,7 @@ cmp_ok(join('',(1,2),3,(4,5)),'eq','12345','list (..).(..)');
test_zero_args("do-returned list slice", do { (10,11)[2,3]; });
}
+{
+ # perl #20321
+ is (join('', @{[('abc'=~/./g)[0,1,2,1,0]]}), "abcba");
+}