diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-06-16 14:51:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-06-16 20:17:20 -0700 |
commit | 16eb5365105fd7ab1815c325059d04765892205f (patch) | |
tree | dce37d999210eb8d946f0d46491b791451815226 /mg.c | |
parent | 4263b84253eeb432b36ff8248a4d601c34af5736 (diff) | |
download | perl-16eb5365105fd7ab1815c325059d04765892205f.tar.gz |
Revert "pos in lvalue context now returns a PVMG instead of a PVLV."
This reverts commit 571f0e8653a532c34edde36e797ecba446978b1c.
I’m afraid I have to revert this, as it does not modify sv_reftype
accordingly, and doing so would add *more* complexity (the opposite
of what that commit was trying to achieve) and slow down ref() at run
time, by making it search for pos magic.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2064,9 +2064,10 @@ int Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg) { dVAR; - SV *const lsv = mg->mg_obj; + SV* const lsv = LvTARG(sv); PERL_ARGS_ASSERT_MAGIC_GETPOS; + PERL_UNUSED_ARG(mg); if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) { MAGIC * const found = mg_find(lsv, PERL_MAGIC_regex_global); @@ -2086,13 +2087,14 @@ int Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) { dVAR; - SV *const lsv = mg->mg_obj; + SV* const lsv = LvTARG(sv); SSize_t pos; STRLEN len; STRLEN ulen = 0; MAGIC* found; PERL_ARGS_ASSERT_MAGIC_SETPOS; + PERL_UNUSED_ARG(mg); if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) found = mg_find(lsv, PERL_MAGIC_regex_global); |