]> granicus.if.org Git - icu/commitdiff
ICU-20544 Regex, Fix assertion failure in positive look-behind
authorAndy Heninger <andy.heninger@gmail.com>
Fri, 12 Apr 2019 20:34:27 +0000 (13:34 -0700)
committerAndy Heninger <andy.heninger@gmail.com>
Fri, 12 Apr 2019 22:27:40 +0000 (15:27 -0700)
icu4c/source/i18n/regexcmp.cpp
icu4c/source/test/testdata/regextst.txt

index dcd754d785f1d42c5b64dc1d633155e8cf98c1c2..e27c3ca597f5a6b82cd0775e767e4ac01a8dfc09 100644 (file)
@@ -2285,7 +2285,7 @@ void  RegexCompile::handleCloseParen() {
                 error(U_REGEX_LOOK_BEHIND_LIMIT);
                 break;
             }
-            if (minML == INT32_MAX && maxML == 0) {
+            if (minML == INT32_MAX) {
                 // This condition happens when no match is possible, such as with a
                 // [set] expression containing no elements.
                 // In principle, the generated code to evaluate the expression could be deleted,
index 552f067af2ee3487b12324a7662beb46393eb9a7..677f48221770d6b0fe71ccd2629f06a1e7e64d14 100644 (file)
 
 "(?<![ⰿ&&m]c)"                     "<0></0>abc"   # note: first 'ⰿ' is \u2c3f, hence empty set.
 "(?<![^\u0000-\U0010ffff]c)"       "<0></0>abc"
+"(?<=[^[^\1a]\1a]†)"                 "abc"          # Problem also exists w positive look-behind
 
 #  Random debugging, Temporary
 #
 
-
 #
 #  Regexps from http://www.regexlib.com
 #