This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest:t/utf8_warn_base.pl: Move a variable outside sub()
[perl5.git] / mg.h
diff --git a/mg.h b/mg.h
index 3aa2401..034fd7e 100644 (file)
--- a/mg.h
+++ b/mg.h
@@ -65,7 +65,7 @@ struct magic {
 /* assumes get-magic and stringification have already occurred */
 # define MgBYTEPOS_set(mg,sv,pv,off) (                  \
     assert_((mg)->mg_type == PERL_MAGIC_regex_global)    \
-    SvPOK(sv) && !SvGMAGICAL(sv)                          \
+    SvPOK(sv) && (!SvGMAGICAL(sv) || sv_only_taint_gmagic(sv))  \
        ? (mg)->mg_len = (off), (mg)->mg_flags |= MGf_BYTES \
        : ((mg)->mg_len = DO_UTF8(sv)                        \
            ? (SSize_t)utf8_length((U8 *)(pv), (U8 *)(pv)+(off)) \
@@ -76,11 +76,5 @@ struct magic {
 #define whichsig(pv) whichsig_pv(pv)
 
 /*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
  * ex: set ts=8 sts=4 sw=4 et:
  */