diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-13 16:24:23 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-07-01 14:05:40 +0200 |
commit | 0177730e7e0c099d1250571eb39367a76e2d91eb (patch) | |
tree | 18f9b6488a03824a8a0217507cec39d9972acaba /mg.c | |
parent | 637174112f90e2e782037f7c706f86617e7df263 (diff) | |
download | perl-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |