diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-10-10 19:18:00 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-10-10 19:18:00 +0000 |
commit | 131b3ad08b25bcfcb31b9933319b3186bdd13248 (patch) | |
tree | 49a4863bce88baf2d0050c81f56637cb3eb2c742 /pp_ctl.c | |
parent | 54cf8e17f0d40db1139c694ac85474f8b0c35b86 (diff) | |
download | perl-131b3ad08b25bcfcb31b9933319b3186bdd13248.tar.gz |
Turn regcomp into a list op
p4raw-id: //depot/perl@23357
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 35 |
1 files changed, 31 insertions, 4 deletions
@@ -83,13 +83,40 @@ PP(pp_regcomp) STRLEN len; MAGIC *mg = Null(MAGIC*); - tmpstr = POPs; - /* prevent recompiling under /o and ithreads. */ #if defined(USE_ITHREADS) - if (pm->op_pmflags & PMf_KEEP && PM_GETRE(pm)) - RETURN; + if (pm->op_pmflags & PMf_KEEP && PM_GETRE(pm)) { + if (PL_op->op_flags & OPf_STACKED) { + dMARK; + SP = MARK; + } + else + (void)POPs; + RETURN; + } #endif + if (PL_op->op_flags & OPf_STACKED) { + /* multiple args; concatentate them */ + dMARK; dORIGMARK; + tmpstr = PAD_SV(ARGTARG); + sv_setpvn(tmpstr, "", 0); + while (++MARK <= SP) { + if (PL_amagic_generation) { + SV *sv; + if ((SvAMAGIC(tmpstr) || SvAMAGIC(*MARK)) && + (sv = amagic_call(tmpstr, *MARK, concat_amg, AMGf_assign))) + { + sv_setsv(tmpstr, sv); + continue; + } + } + sv_catsv(tmpstr, *MARK); + } + SvSETMAGIC(tmpstr); + SP = ORIGMARK; + } + else + tmpstr = POPs; if (SvROK(tmpstr)) { SV *sv = SvRV(tmpstr); |