diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-14 17:52:46 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-14 17:52:46 +0200 |
commit | 571f0e8653a532c34edde36e797ecba446978b1c (patch) | |
tree | 18d660b59511c06bf87d4f66ad66c2645444c147 /pp.c | |
parent | 41e07bbccec49c484a622d86a1ba01136a740d9f (diff) | |
download | perl-571f0e8653a532c34edde36e797ecba446978b1c.tar.gz |
pos in lvalue context now returns a PVMG instead of a PVLV.
Store the target SV in mg_obj, instead of LvTARG(). This slightly reduces both
code complexity and runtime memory use.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -361,10 +361,8 @@ PP(pp_pos) dVAR; dSP; dPOPss; if (PL_op->op_flags & OPf_MOD || LVRET) { - SV * const ret = sv_2mortal(newSV_type(SVt_PVLV)); /* Not TARG RT#67838 */ - sv_magic(ret, NULL, PERL_MAGIC_pos, NULL, 0); - LvTYPE(ret) = '.'; - LvTARG(ret) = SvREFCNT_inc_simple(sv); + SV * const ret = sv_2mortal(newSV_type(SVt_PVMG)); /* Not TARG RT#67838 */ + sv_magic(ret, sv, PERL_MAGIC_pos, NULL, 0); PUSHs(ret); /* no SvSETMAGIC */ RETURN; } |