This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Copy RE capture buf on overload as well as TEMP
[perl5.git] / pp_hot.c
index 02f425a..25a804a 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1336,7 +1336,7 @@ PP(pp_match)
        appears to be quite tricky.
        Test for the unsafe vars are TODO for now. */
     if ((  !global && RX_NPARENS(rx)) 
-           || SvTEMP(TARG) || PL_sawampersand ||
+           || SvTEMP(TARG) || SvAMAGIC(TARG) || PL_sawampersand ||
            (RX_EXTFLAGS(rx) & (RXf_EVAL_SEEN|RXf_PMf_KEEPCOPY)))
        r_flags |= REXEC_COPY_STR;
     if (SvSCREAM(TARG))