From 2360cd68127e75c48ae54a165bf882455ec55e1c Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 20 Dec 1999 16:28:51 +0000 Subject: [PATCH] avoid pp_regcomp() changing optree at run time under USE_*THREADS (or we have a race on our hands) p4raw-id: //depot/perl@4700 --- pp_ctl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } -- 2.7.4