This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Fix failing CI 32-bit tests
[perl5.git] / regexec.c
index 74f95e7..61a3075 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -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 */