re_intuit_start(): don't decrease rx_origin
authorDavid Mitchell <davem@iabyn.com>
Wed, 5 Feb 2014 17:32:22 +0000 (17:32 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 8 Feb 2014 13:50:23 +0000 (13:50 +0000)
commitb96863b839ade8b79f6216567b6e5be6f881700e
treee6f449a4f666d6d6d5eb8af866d0801cb9ea19b1
parenta6566820c258792b90db16cf731c02777286aba0
re_intuit_start(): don't decrease rx_origin

When calculating the new rx_origin after a successful check match,
don't set it to a lower value than it already is. This can avoid
having to do repeated HOP(check_at, -max_offset) over the same
section of string, which makes the following take milliseconds rather than
10's of seconds:

    $s = "-a-bc" x 250_000;
    $s .= "1a1bc";
    utf8::upgrade($s);
    $s =~ /\da\d{0,30000}bc/ or die;
regexec.c
t/re/pat.t