summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-03-17 16:46:44 +0000
committerNicholas Clark <nick@ccl4.org>2006-03-17 16:46:44 +0000
commitd300d9fa075a7f8773308c940f2711226efe4f42 (patch)
tree5dae36bf034b513b85eff15c577c5d6924194e0c /regexec.c
parent6407bf3bededaf57267b14aadbfe114045362404 (diff)
downloadperl-d300d9fa075a7f8773308c940f2711226efe4f42.tar.gz
Restore a bit of change 27533 that change 27534 inadvertently unwound.
p4raw-id: //depot/perl@27535
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/regexec.c b/regexec.c
index 2b7fdfa161..c79bee08fc 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2130,9 +2130,12 @@ S_regtry(pTHX_ regexp *prog, char *startpos)
if (!(SvTYPE(PL_reg_sv) >= SVt_PVMG && SvMAGIC(PL_reg_sv)
&& (mg = mg_find(PL_reg_sv, PERL_MAGIC_regex_global)))) {
/* prepare for quick setting of pos */
- sv_magic(PL_reg_sv, (SV*)0,
- PERL_MAGIC_regex_global, NULL, 0);
- mg = mg_find(PL_reg_sv, PERL_MAGIC_regex_global);
+#ifdef PERL_OLD_COPY_ON_WRITE
+ if (SvIsCOW(sv))
+ sv_force_normal_flags(sv, 0);
+#endif
+ mg = sv_magicext(PL_reg_sv, (SV*)0, PERL_MAGIC_regex_global,
+ &PL_vtbl_mglob, NULL, 0);
mg->mg_len = -1;
}
PL_reg_magic = mg;