Skip to content

Commit f6231eb

Browse files
committed
regcomp.c: Get rid of meaningless test
Since ea3daa5, parts of this test became nonsensical as max_offset cannot be larger than OPTIMIZE_INFIINITY. (I don't know why compilers didn't say that this branch is always false.) Hugo van der Sanden suggested something like this commit to keep the still valid part of the test.
1 parent be87901 commit f6231eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

regcomp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,14 +1491,14 @@ S_scan_commit(pTHX_ const RExC_state_t *pRExC_state, scan_data_t *data,
14911491
if (!i) /* fixed */
14921492
data->substrs[0].max_offset = data->substrs[0].min_offset;
14931493
else { /* float */
1494-
data->substrs[1].max_offset = (l
1494+
data->substrs[1].max_offset =
1495+
(is_inf)
1496+
? OPTIMIZE_INFTY
1497+
: (l
14951498
? data->last_start_max
14961499
: (data->pos_delta > OPTIMIZE_INFTY - data->pos_min
14971500
? OPTIMIZE_INFTY
14981501
: data->pos_min + data->pos_delta));
1499-
if (is_inf
1500-
|| (STRLEN)data->substrs[1].max_offset > (STRLEN)OPTIMIZE_INFTY)
1501-
data->substrs[1].max_offset = OPTIMIZE_INFTY;
15021502
}
15031503

15041504
if (data->flags & SF_BEFORE_EOL)

0 commit comments

Comments
 (0)