This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
when cloning PL_regex_pad, copy SVf_BREAK flag too
[perl5.git] / sv.c
diff --git a/sv.c b/sv.c
index 33cdb52..bfc9ee7 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -11025,6 +11025,8 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
                        newSViv(PTR2IV(CALLREGDUPE(
                                INT2PTR(REGEXP *, SvIVX(regex)), param))))
                ;
+           if (SvFLAGS(regex) & SVf_BREAK)
+               SvFLAGS(sv) |= SVf_BREAK; /* unrefcnted PL_curpm */
            av_push(PL_regex_padav, sv);
        }
     }