]> granicus.if.org Git - icu/commitdiff
ICU-8666 Fix regular expression assertion failure on match
authorAndy Heninger <andy.heninger@gmail.com>
Tue, 28 Jun 2011 05:35:42 +0000 (05:35 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Tue, 28 Jun 2011 05:35:42 +0000 (05:35 +0000)
X-SVN-Rev: 30244

icu4c/source/i18n/regexcmp.cpp
icu4c/source/test/testdata/regextst.txt

index c77181d9ec1f7ccccb0f8d832976ca7bd35c8884..968d08123fd7c186951019ec4ccecc051d2f089e 100644 (file)
@@ -1962,6 +1962,7 @@ void   RegexCompile::insertOp(int32_t where) {
             opType == URX_CTR_LOOP     ||
             opType == URX_CTR_LOOP_NG  ||
             opType == URX_JMP_SAV      ||
+            opType == URX_JMP_SAV_X    ||
             opType == URX_RELOC_OPRND)    && opValue > where) {
             // Target location for this opcode is after the insertion point and
             //   needs to be incremented to adjust for the insertion.
index 3de486ac54903870ea8c795874657675848b2eec..563fb7f20fc123a7d3d2027bc7d3af93d7a0c4da 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2001-2010 International Business Machines
+# Copyright (c) 2001-2011 International Business Machines
 # Corporation and others. All Rights Reserved.
 #
 #  file:
 "(?!0{5})(\d{5})(?!-?0{4})(-?\d{4})?"    "<0><1>94040</1><2>-3344</2></0>"
 "(?!0{5})(\d{5})(?!-?0{4})(-?\d{4})?"    "94040-0000"
 "(?!0{5})(\d{5})(?!-?0{4})(-?\d{4})?"    "00000-3344"
+
+#
+#    Bug 8666.  Assertion failure on match, bad operand to JMP_SAV_X opcode.
 #
+"((.??)+|A)*"                     "<0><1><2></2></1></0>AAAAABBBBBCCCCCDDDDEEEEE"
+
 #  Random debugging, Temporary
 #
 #"^(?:a?b?)*$"                   "a--"
-"^(?:a?b?)*$"                    "a--"
 
 "This is a string with (?:one |two |three )endings"   "<0>This is a string with two endings</0>"
 "((?:a|b|c)whoop-dee-do) | [jkl]|zed"             "x"