diff options
author | Hugo van der Sanden <hv@crypt.org> | 2019-08-08 17:27:14 +0100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-05-31 08:05:43 -0600 |
commit | 8227b2b69230eaeea8f88d757b20021608518279 (patch) | |
tree | 53f104c12c33fb81751d412b58d479299e41d8b6 /regcomp.c | |
parent | e096e509321e540009a195ee8530c7dd07c62125 (diff) | |
download | perl-8227b2b69230eaeea8f88d757b20021608518279.tar.gz |
[gh 17847] data->pos_delta should stick at infinity
The expression we're about to add to data->pos_delta in this part of
study_chunk() can be both positive or negative; however while we apply
an overflow check to avoid exceeding OPTIMIZE_INFTY, we were happily
subtracting from it when the expression was negative, making it no longer
infinite.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -5842,6 +5842,7 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n", - minnext * mincount), (UV)(OPTIMIZE_INFTY - data->pos_delta)); #endif if (deltanext == OPTIMIZE_INFTY + || data->pos_delta == OPTIMIZE_INFTY || -counted * deltanext + (minnext + deltanext) * maxcount - minnext * mincount >= OPTIMIZE_INFTY - data->pos_delta) data->pos_delta = OPTIMIZE_INFTY; else |