Re: [perl #32687] Encode::is_utf8 on tainted UTF8 string
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 25cfe5f..124a40f 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -118,9 +118,9 @@ PP(pp_regcomp)
            mg = mg_find(sv, PERL_MAGIC_qr);
     }
     if (mg) {
-       regexp * const re = (regexp *)mg->mg_obj;
+       regexp * const re = reg_temp_copy((regexp *)mg->mg_obj);
        ReREFCNT_dec(PM_GETRE(pm));
-       PM_SETRE(pm, ReREFCNT_inc(re));
+       PM_SETRE(pm, re);
     }
     else {
        STRLEN len;