summaryrefslogtreecommitdiff
path: root/t/bigmem
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-07-30 23:49:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-25 12:23:59 -0700
commit49f55535e0b402f8cbdf839b5f2c88306c91a31d (patch)
tree53d85774d91296f9ee177a27425e7be58dcf2dd7 /t/bigmem
parenta10eae290937db109954431d254a9a25287f190b (diff)
downloadperl-49f55535e0b402f8cbdf839b5f2c88306c91a31d.tar.gz
Stop substr re optimisation from rejecting long strs
Using I32 for the fields that record information about the location of a fixed string that must be found for a regular expression to match can result in match failures, because I32 is not large enough to store offsets >= 2**31. SSize_t is appropriate, since it is 64 bits on 64-bit platforms and 32 bits on 32-bit platforms. This commit changes enough instances of I32 to SSize_t to get the added test passing and suppress compiler warnings. A later commit will change many more.
Diffstat (limited to 't/bigmem')
-rw-r--r--t/bigmem/regexp.t6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/bigmem/regexp.t b/t/bigmem/regexp.t
index 9404f2cc96..d5496f1cbb 100644
--- a/t/bigmem/regexp.t
+++ b/t/bigmem/regexp.t
@@ -12,7 +12,7 @@ $ENV{PERL_TEST_MEMORY} >= 2
$Config{ptrsize} >= 8
or skip_all("Need 64-bit pointers for this test");
-plan(5);
+plan(6);
# [perl #116907]
# ${\2} to defeat constant folding, which in this case actually slows
@@ -33,3 +33,7 @@ $x =~ /./g;
is "$'", 'efg', q "$' after match against long string";
is "$-[0],$+[0]", '2147483651,2147483652',
'@- and @+ after matches past 2**31';
+
+# Substring optimisations
+is $x =~ /(?:(?:.{32766}){32766}){2}(?:.{32766}){8}.{8}ef/, 1,
+ 'anchored substr past 2**31';