Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/pcre2_match_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ do_bumpalong(pcre2_match_data *match_data, PCRE2_SIZE offset)
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_next_match(pcre2_match_data *match_data, PCRE2_SIZE *pstart_offset, uint32_t *poptions)
{
/* Preconditions on argument values */

PCRE2_ASSERT(match_data != NULL);
PCRE2_ASSERT(pstart_offset != NULL);
PCRE2_ASSERT(poptions != NULL);

PCRE2_SIZE start_offset = match_data->start_offset;
PCRE2_SIZE *ovector = match_data->ovector;

Expand All @@ -105,6 +111,10 @@ pcre2_next_match(pcre2_match_data *match_data, PCRE2_SIZE *pstart_offset, uint32
if (match_data->rc < 0)
return FALSE;

/* Preconditions on argument state */

PCRE2_ASSERT(match_data->code != NULL);

/* Match succeeded: get the start offset for the next match */

/* Although \K can affect the position of ovector[0], there are no ways to do
Expand Down