diff options
author | David Mitchell <davem@iabyn.com> | 2010-04-21 18:47:07 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-04-21 19:01:00 +0100 |
commit | 2d961f6deff76f15f1e5c200d92c2ea6139bcdd2 (patch) | |
tree | d1213af331d0d6578906cded557681a10ff95d11 /av.c | |
parent | 433d4b0fb3195bdf6cc90be8b502b4308c90d578 (diff) | |
download | perl-2d961f6deff76f15f1e5c200d92c2ea6139bcdd2.tar.gz |
follow up fix for fd69380d5d5b95ef16e2521cf4251b34ee0ce151
The original fix for tied elements losing magic had a bug that was masked
by a bool casting issue. Once the casting was fixed, the bug surfaced:
elements of @+ lost their values when returned from a sub. By removing the
TEMP flag from the regdatum PVLV, we force it to be copied when returned.
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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)); |