From: Gurusamy Sarathy Date: Mon, 20 Dec 1999 16:28:51 +0000 (+0000) Subject: avoid pp_regcomp() changing optree at run time under USE_*THREADS (or X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2360cd68127e75c48ae54a165bf882455ec55e1c;p=p5sagit%2Fp5-mst-13.2.git avoid pp_regcomp() changing optree at run time under USE_*THREADS (or we have a race on our hands) p4raw-id: //depot/perl@4700 --- diff --git a/pp_ctl.c b/pp_ctl.c index feec363..0bb6919 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -87,6 +87,13 @@ PP(pp_regcomp) STRLEN len; MAGIC *mg = Null(MAGIC*); +#if defined(USE_ITHREADS) || defined(USE_THREADS) + if ((pm->op_pmflags & PMf_KEEP) && !(pm->op_private & OPpRUNTIME)) { + /* no point compiling again */ + RETURN; + } +#endif + tmpstr = POPs; if (SvROK(tmpstr)) { SV *sv = SvRV(tmpstr); @@ -134,9 +141,13 @@ PP(pp_regcomp) else if (strEQ("\\s+", pm->op_pmregexp->precomp)) pm->op_pmflags |= PMf_WHITE; + /* XXX runtime compiled output needs to move to the pad */ if (pm->op_pmflags & PMf_KEEP) { pm->op_private &= ~OPpRUNTIME; /* no point compiling again */ +#if !defined(USE_ITHREADS) && !defined(USE_THREADS) + /* XXX can't change the optree at runtime either */ cLOGOP->op_first->op_next = PL_op->op_next; +#endif } RETURN; }