diff options
-rw-r--r-- | embed.fnc | 1 | ||||
-rw-r--r-- | embed.h | 1 | ||||
-rw-r--r-- | proto.h | 3 | ||||
-rw-r--r-- | regcomp.c | 14 |
4 files changed, 17 insertions, 2 deletions
@@ -1532,6 +1532,7 @@ EiMn |void |invlist_set_previous_index|NN SV* const invlist|const IV index EiMRn |IV |invlist_previous_index|NN SV* const invlist EiMn |void |invlist_trim |NN SV* invlist #endif +EiM |void |invlist_clear |NN SV* invlist EiMR |SV* |invlist_clone |NN SV* const invlist EiMRn |STRLEN*|get_invlist_iter_addr |NN SV* invlist EiMn |void |invlist_iterinit|NN SV* invlist @@ -1002,6 +1002,7 @@ #define handle_named_backref(a,b,c,d) S_handle_named_backref(aTHX_ a,b,c,d) #define handle_possible_posix(a,b,c,d) S_handle_possible_posix(aTHX_ a,b,c,d) #define handle_regex_sets(a,b,c,d,e) S_handle_regex_sets(aTHX_ a,b,c,d,e) +#define invlist_clear(a) S_invlist_clear(aTHX_ a) #define invlist_clone(a) S_invlist_clone(aTHX_ a) #define invlist_contents(a,b) S_invlist_contents(aTHX_ a,b) #define invlist_extend(a,b) S_invlist_extend(aTHX_ a,b) @@ -4749,6 +4749,9 @@ STATIC int S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state, const char* STATIC regnode* S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV ** return_invlist, I32 *flagp, U32 depth, char * const oregcomp_parse); #define PERL_ARGS_ASSERT_HANDLE_REGEX_SETS \ assert(pRExC_state); assert(flagp); assert(oregcomp_parse) +PERL_STATIC_INLINE void S_invlist_clear(pTHX_ SV* invlist); +#define PERL_ARGS_ASSERT_INVLIST_CLEAR \ + assert(invlist) PERL_STATIC_INLINE SV* S_invlist_clone(pTHX_ SV* const invlist) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_INVLIST_CLONE \ @@ -8442,6 +8442,17 @@ S_invlist_trim(SV* invlist) } } +PERL_STATIC_INLINE void +S_invlist_clear(pTHX_ SV* invlist) /* Empty the inversion list */ +{ + PERL_ARGS_ASSERT_INVLIST_CLEAR; + + assert(SvTYPE(invlist) == SVt_INVLIST); + + invlist_set_len(invlist, 0, 0); + invlist_trim(invlist); +} + #endif /* ifndef PERL_IN_XSUB_RE */ PERL_STATIC_INLINE bool @@ -9357,8 +9368,7 @@ Perl__invlist_intersection_maybe_complement_2nd(pTHX_ SV* const a, SV* const b, invlist_replace_list_destroys_src(*i, r); } else { - invlist_set_len(*i, 0, 0); - invlist_trim(*i); + invlist_clear(*i); } SvREFCNT_dec_NN(r); } |