diff options
author | David Mitchell <davem@iabyn.com> | 2011-11-01 16:50:16 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-06-13 13:25:51 +0100 |
commit | 867940b89f1d3f001a6df1d888925b9ca246fe96 (patch) | |
tree | 991a8c53521998798452aa071aa5e20523bb6a6d /op.h | |
parent | 188c19101137d65e1d1aa0bc4df26a0e6287f97d (diff) | |
download | perl-867940b89f1d3f001a6df1d888925b9ca246fe96.tar.gz |
add PMf_CODELIST_PRIVATE flag
This indicates that the op_code_list field in a PMOP is "private";
that is, it points to a list of DO blocks that we don't own, and
shouldn't free, and whose pad may not match ours.
This will allow us to use the op_code_list field in the runtime case of
literal code, e.g. /$runtime(?{...})/ and qr/$runtime(?{...})/. Here, at
compile-time, we need to make the pre-compiled (?{..}) blocks available to
pp_regcomp, but the list containing those blocks is also the list that is
executed in the lead-up to executing pp_regcomp (while skipping the DO
blocks), so the code is already embedded, and doesn't need freeing.
Furthermore, in the qr// case, the code blocks are actually within a
different sub (an anon one) than the PMOP, so the pads won't match.
Diffstat (limited to 'op.h')
-rw-r--r-- | op.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -437,7 +437,11 @@ struct pmop { /* the pattern has a CV attached (currently only under qr/...(?{}).../) */ #define PMf_HAS_CV (1<<(PMf_BASE_SHIFT+10)) -#if PMf_BASE_SHIFT+10 > 31 +/* op_code_list is private; don't free it etc. It may well point to + * code within another sub, with different pad etc */ +#define PMf_CODELIST_PRIVATE (1<<(PMf_BASE_SHIFT+11)) + +#if PMf_BASE_SHIFT+11 > 31 # error Too many PMf_ bits used. See above and regnodes.h for any spare in middle #endif |