Skip to content

Commit ad1e508

Browse files
committed
lregex: add assertions for setting mgroup= flag
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent a936474 commit ad1e508

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main/lregex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,7 @@ static bool matchMultilineRegexPattern (struct lregexControlBlock *lcb,
19791979

19801980
if (patbuf->type == PTRN_TAG)
19811981
{
1982+
Assert (mgroup->forLineNumberDetermination != NO_MULTILINE);
19821983
off_t offset = (current + pmatch [mgroup->forLineNumberDetermination].rm_so)
19831984
- start;
19841985
matchTagPattern (lcb, current, patbuf, pmatch, offset,
@@ -2777,6 +2778,7 @@ static struct regexTable * matchMultitableRegexTable (struct lregexControlBlock
27772778

27782779
if (ptrn->type == PTRN_TAG)
27792780
{
2781+
Assert (ptrn->mgroup.forLineNumberDetermination != NO_MULTILINE);
27802782
off_t offset_for_tag = (current
27812783
+ pmatch [ptrn->mgroup.forLineNumberDetermination].rm_so)
27822784
- cstart;

0 commit comments

Comments
 (0)