diff options
author | David Mitchell <davem@iabyn.com> | 2011-12-08 15:43:41 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-06-13 13:32:46 +0100 |
commit | 514a91f155137f90b0b252807e2c009f04c97938 (patch) | |
tree | 43a22ccf6aa6cfa23c12f97827eb16ee3d1c210c /pp_ctl.c | |
parent | 37acfcba9f5180cec9aa03bf3457caab7114230c (diff) | |
download | perl-514a91f155137f90b0b252807e2c009f04c97938.tar.gz |
re_op_compile(): split flags into two arguments
There are two sets of regex-related flags; the RXf_* which
end up in the extflags field of a REGEXP, and the PMf_*, which
are in the op_pmflags field of a PMOP.
Since I added the PMf_HAS_CV and PMf_IS_QR flags, I've been conflating
these two meanings in the single flags arg to re_op_compile(), which meant
that some bits were being misinterpreted. The only test that was failing
was peek.t, but it may have quietly broken other things that simply
weren't tested for (for example PMf_HAS_CV and RXf_SPLIT share the same
value, so something with split qr/(?{...})/ might get messed up).
So, split this arg into two; one for the RXf* flags, and one for the PMf_*
flags.
The public regexp API continues to have only a single flags arg,
which should only be accepting RXf_* flags.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -115,7 +115,8 @@ PP(pp_regcomp) new_re = re_op_compile(args, nargs, pm->op_code_list, eng, re, &is_bare_re, - (pm->op_pmflags & (RXf_PMf_COMPILETIME|PMf_HAS_CV|PMf_IS_QR))); + (pm->op_pmflags & RXf_PMf_COMPILETIME), + pm->op_pmflags); if (pm->op_pmflags & PMf_HAS_CV) ((struct regexp *)SvANY(new_re))->qr_anoncv = (CV*) SvREFCNT_inc(PAD_SV(PL_op->op_targ)); |