diff options
author | Karl Williamson <khw@cpan.org> | 2018-10-14 16:59:50 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-10-20 00:09:55 -0600 |
commit | ebc61c6df0a1d53ff385289afdd2552c413ed11d (patch) | |
tree | fc41963499340ab70d17c67cb375ec4192ee7ef5 /regcomp.c | |
parent | bec95d5a289feff3ffa0c7f4f0e461b758c27d5f (diff) | |
download | perl-ebc61c6df0a1d53ff385289afdd2552c413ed11d.tar.gz |
regcomp.c: Defer setting the OP variant of a regnode
This is in preparation for a future commit. We have allocated space and
know that the regnode will be some time of ANYOF one. But we don't need
to know which one precisely until later than we had been setting it.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -16574,6 +16574,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, one. */ U8 anyof_flags = 0; /* flag bits if the node is an ANYOF-type */ U32 posixl = 0; /* bit field of posix classes matched under /l */ + bool use_anyofd = FALSE; /* ? Is this to be an ANYOFD node */ GET_RE_DEBUG_FLAGS_DECL; @@ -18378,7 +18379,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, && ( has_upper_latin1_only_utf8_matches || (anyof_flags & ANYOF_SHARED_d_MATCHES_ALL_NON_UTF8_NON_ASCII_non_d_WARN_SUPER))) { - OP(REGNODE_p(ret)) = ANYOFD; + use_anyofd = TRUE; optimizable = FALSE; } @@ -18389,7 +18390,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, * */ if ( cp_list && invert - && OP(REGNODE_p(ret)) != ANYOFD + && ! use_anyofd && ! (anyof_flags & (ANYOF_LOCALE_FLAGS)) && ! HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION) { @@ -18710,6 +18711,14 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, } } + /* It's going to be an ANYOF node. */ + OP(REGNODE_p(ret)) = (use_anyofd) + ? ANYOFD + : ((posixl) + ? ANYOFPOSIXL + : ((LOC) + ? ANYOFL + : ANYOF)); ANYOF_FLAGS(REGNODE_p(ret)) = anyof_flags; /* Here, <cp_list> contains all the code points we can determine at |