summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 64c7d2085f..1bdf5c4cda 100644
--- a/mg.c
+++ b/mg.c
@@ -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);