diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pcre_dfa_exec.c | 4 | ||||
-rw-r--r-- | testdata/testinput8 | 3 | ||||
-rw-r--r-- | testdata/testoutput8 | 4 |
4 files changed, 12 insertions, 2 deletions
@@ -34,6 +34,9 @@ are fixed: property for a character with a code point greater than 0x10ffff (the Unicode maximum) caused a crash. +8. The alternative matching function, pcre_dfa_exec() misbehaved if it +encountered a character class with a possessive repeat, for example [a-f]{3}+. + Version 8.40 11-January-2017 ---------------------------- diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c index 170ce6a..bc09ced 100644 --- a/pcre_dfa_exec.c +++ b/pcre_dfa_exec.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language (but see below for why this module is different). Written by Philip Hazel - Copyright (c) 1997-2014 University of Cambridge + Copyright (c) 1997-2017 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -2625,7 +2625,7 @@ for (;;) if (isinclass) { int max = (int)GET2(ecode, 1 + IMM2_SIZE); - if (*ecode == OP_CRPOSRANGE) + if (*ecode == OP_CRPOSRANGE && count >= (int)GET2(ecode, 1)) { active_count--; /* Remove non-match possibility */ next_active_state--; diff --git a/testdata/testinput8 b/testdata/testinput8 index 7f8fa82..e931410 100644 --- a/testdata/testinput8 +++ b/testdata/testinput8 @@ -4845,4 +4845,7 @@ aaa\D a\D +/(02-)?[0-9]{3}-[0-9]{3}/ + 02-123-123 + /-- End of testinput8 --/ diff --git a/testdata/testoutput8 b/testdata/testoutput8 index 17b667a..4984376 100644 --- a/testdata/testoutput8 +++ b/testdata/testoutput8 @@ -7801,4 +7801,8 @@ No match ** Show all captures ignored after DFA matching 0: a +/(02-)?[0-9]{3}-[0-9]{3}/ + 02-123-123 + 0: 02-123-123 + /-- End of testinput8 --/ |