Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop minlen regexp optimisation from rejecting long strings
This fixes #112790 and part of #116907. The length of the string is cast to I32, so it wraps and end up less than the minimum length. For now, simply skip this optimisation if minlen itself wraps and becomes negative.
- Loading branch information
Father Chrysostomos
committed
Aug 25, 2013
1 parent
bf05793
commit 389ecb5
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!perl | ||
BEGIN { | ||
chdir 't'; | ||
unshift @INC, "../lib"; | ||
require './test.pl'; | ||
} | ||
|
||
use Config qw(%Config); | ||
|
||
$ENV{PERL_TEST_MEMORY} >= 2 | ||
or skip_all("Need ~2Gb for this test"); | ||
$Config{ptrsize} >= 8 | ||
or skip_all("Need 64-bit pointers for this test"); | ||
|
||
plan(2); | ||
|
||
# [perl #116907] | ||
# ${\2} to defeat constant folding, which in this case actually slows | ||
# things down | ||
my $x=" "x(${\2}**31); | ||
ok $x =~ /./, 'match against long string succeeded'; | ||
is "$-[0]-$+[0]", '0-1', '@-/@+ after match against long string'; |