diff options
author | Karl Williamson <khw@cpan.org> | 2020-12-21 11:04:02 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-12-21 11:09:35 -0700 |
commit | 1a7ee1dc1e657347ff0fa95272f0cbecbfca421f (patch) | |
tree | 2a71de235a31bd613deb4054317c8a160465a51b /regexec.c | |
parent | 2f338e940005dc728823c28fe6289f055e27f853 (diff) | |
download | perl-1a7ee1dc1e657347ff0fa95272f0cbecbfca421f.tar.gz |
regexec.c: Fix failing CI 32-bit tests
This bug was introduced by bb3825626ed2b1217a2ac184eff66d0d4ed6e070, and
was the result of overflowing a 32 bit space. The solution is to rework
the expression so that it can't overflow.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -10019,7 +10019,9 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, if (definitive_len == 1) { const char * orig_scan = scan; - this_eol = MIN(this_eol, scan + max - hardcount); + if (this_eol - (scan - hardcount) > max) { + this_eol = scan - hardcount + max; + } /* Use different routines depending on whether it's an * exact match or matches with a mask */ |