summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--av.c2
-rw-r--r--t/op/magic.t2
2 files changed, 3 insertions, 1 deletions
diff --git a/av.c b/av.c
index fb853a648c..94b5f2c559 100644
--- a/av.c
+++ b/av.c
@@ -245,6 +245,8 @@ Perl_av_fetch(pTHX_ register AV *av, I32 key, I32 lval)
sv = sv_newmortal();
sv_upgrade(sv, SVt_PVLV);
mg_copy(MUTABLE_SV(av), sv, 0, key);
+ if (!tied_magic) /* for regdata, force leavesub to make copies */
+ SvTEMP_off(sv);
LvTYPE(sv) = 't';
LvTARG(sv) = sv; /* fake (SV**) */
return &(LvTARG(sv));
diff --git a/t/op/magic.t b/t/op/magic.t
index bef4922719..60d81ae656 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -466,13 +466,13 @@ is "@+", "10 1 6 10";
# Test for bug [perl #27839]
{
- local $TODO = "fixing a casting issue revealed broken behaviour in this test";
my $x;
sub f {
"abc" =~ /(.)./;
$x = "@+";
return @+;
};
+ "pqrstuvwxyz" =~ /..(....)../; # prime @+ etc in this scope
my @y = f();
is $x, "@y", "return a magic array ($x) vs (@y)";