diff options
author | David Mitchell <davem@iabyn.com> | 2014-03-15 14:27:47 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-03-16 18:03:50 +0000 |
commit | 000dfd2d23e52925b97fdb70c3a45e996df1ff2e (patch) | |
tree | 8984c3a7a9837fff065fffe81db1352266ab1983 /t/re/re_tests | |
parent | c43b55202cde0bd54e79e98bc90ceaecb135c151 (diff) | |
download | perl-000dfd2d23e52925b97fdb70c3a45e996df1ff2e.tar.gz |
re_intuit_start(): fix byte/char calculation err
On failure to find stclass in float range, it currently does:
rx_origin = check_at - start_shift;
which should instead be
rx_origin = HOP3c(check_at, - start_shift, strbeg);
The second added test is an example of when this causes a false negative.
(The first test is just the analogue without a UTF8 string, so it already
passes).
Since we actually already calculate this value earlier as part of
determining endpos in the float case, assign the result of that calc to a
local var, then just reuse it.
Diffstat (limited to 't/re/re_tests')
-rw-r--r-- | t/re/re_tests | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/t/re/re_tests b/t/re/re_tests index 3bb0ae5011..7ab7dc34fc 100644 --- a/t/re/re_tests +++ b/t/re/re_tests @@ -1881,6 +1881,8 @@ A+(*PRUNE)BC(?{}) AAABC y $& AAABC /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\13\14/ abcdefghijk\12\13\14 y $& abcdefghijk\12\13\14 \d<(.*?)> a<> n - - +[bcd].{2,3}aaaa XbXaaaaa y - - +[bcd].{2,3}aaaa Xb\x{100}aaaaa y - - # Keep these lines at the end of the file # vim: softtabstop=0 noexpandtab |