summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-14 17:52:46 +0200
committerNicholas Clark <nick@ccl4.org>2011-06-14 17:52:46 +0200
commit571f0e8653a532c34edde36e797ecba446978b1c (patch)
tree18d660b59511c06bf87d4f66ad66c2645444c147 /pp.c
parent41e07bbccec49c484a622d86a1ba01136a740d9f (diff)
downloadperl-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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 385f1beef1..f87e0dd3a4 100644
--- a/pp.c
+++ b/pp.c
@@ -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;
}