summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-13 16:24:23 +0200
committerNicholas Clark <nick@ccl4.org>2011-07-01 14:05:40 +0200
commit0177730e7e0c099d1250571eb39367a76e2d91eb (patch)
tree18f9b6488a03824a8a0217507cec39d9972acaba /mg.c
parent637174112f90e2e782037f7c706f86617e7df263 (diff)
downloadperl-0177730e7e0c099d1250571eb39367a76e2d91eb.tar.gz
Split out study magic from pos magic.
study uses magic to call SvSCREAM_off() if the scalar is modified. Allocate it its own magic type ('G' for now - pos magic is 'g'). Share the same "set" routine and vtable as regexp/bm/fm (setregxp and vtbl_regexp).
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 1bdf5c4cda..9e1891833b 100644
--- a/mg.c
+++ b/mg.c
@@ -2358,9 +2358,8 @@ Perl_magic_setmglob(pTHX_ SV *sv, MAGIC *mg)
{
PERL_ARGS_ASSERT_MAGIC_SETMGLOB;
PERL_UNUSED_CONTEXT;
+ PERL_UNUSED_ARG(sv);
mg->mg_len = -1;
- if (!isGV_with_GP(sv))
- SvSCREAM_off(sv);
return 0;
}
@@ -2387,6 +2386,9 @@ Perl_magic_setregexp(pTHX_ SV *sv, MAGIC *mg)
} else if (type == PERL_MAGIC_bm) {
SvTAIL_off(sv);
SvVALID_off(sv);
+ } else if (type == PERL_MAGIC_study) {
+ if (!isGV_with_GP(sv))
+ SvSCREAM_off(sv);
} else {
assert(type == PERL_MAGIC_fm);
}