EXMpR |HV* |_swash_to_invlist |NN SV* const swash
EXMp |void |_append_range_to_invlist |NN HV* const invlist|const UV start|const UV end
#ifdef PERL_IN_REGCOMP_C
-EsMR |HV* |add_range_to_invlist |NN HV* const invlist|const UV start|const UV end
+EsMR |HV* |add_range_to_invlist |NULLOK HV* invlist|const UV start|const UV end
EiMR |UV* |invlist_array |NN HV* const invlist
EiM |void |invlist_destroy |NN HV* const invlist
EsM |void |invlist_extend |NN HV* const invlist|const UV len
#define PERL_ARGS_ASSERT_ADD_DATA \
assert(pRExC_state); assert(s)
-STATIC HV* S_add_range_to_invlist(pTHX_ HV* const invlist, const UV start, const UV end)
- __attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_ADD_RANGE_TO_INVLIST \
- assert(invlist)
+STATIC HV* S_add_range_to_invlist(pTHX_ HV* invlist, const UV start, const UV end)
+ __attribute__warn_unused_result__;
STATIC void S_checkposixcc(pTHX_ struct RExC_state_t *pRExC_state)
__attribute__nonnull__(pTHX_1);
}
STATIC HV*
-S_add_range_to_invlist(pTHX_ HV* const invlist, const UV start, const UV end)
+S_add_range_to_invlist(pTHX_ HV* invlist, const UV start, const UV end)
{
/* Add the range from 'start' to 'end' inclusive to the inversion list's
* set. A pointer to the inversion list is returned. This may actually be
- * a new list, in which case the passed in one has been destroyed */
+ * a new list, in which case the passed in one has been destroyed. The
+ * passed in inversion list can be NULL, in which case a new one is created
+ * with just the one range in it */
HV* range_invlist;
HV* added_invlist;
+ UV len;
- UV len = invlist_len(invlist);
-
- PERL_ARGS_ASSERT_ADD_RANGE_TO_INVLIST;
+ if (invlist == NULL) {
+ invlist = _new_invlist(2);
+ len = 0;
+ }
+ else {
+ len = invlist_len(invlist);
+ }
/* If comes after the final entry, can just append it to the end */
if (len == 0