summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-03-19 21:49:30 -0600
committerKarl Williamson <khw@cpan.org>2015-03-19 22:53:01 -0600
commit3071c56699e6a52355bb59a16e1d309f92d749e6 (patch)
treebb32851a2ca25775808f7b9d9f68d7749847f072 /regcomp.c
parentf79a09fc4ef966ff9221ae0bb352421069688fe8 (diff)
downloadperl-3071c56699e6a52355bb59a16e1d309f92d749e6.tar.gz
regcomp.c: Fix so works on Unicode 5.2
Unicode 5.2 had an anomalous situation, fixed in the next release, which runs afoul of an assert() in regcomp.c. This just modifies the assert for it to not fail for this situation.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 51065d58f2..8c3dffd451 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -15093,9 +15093,18 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
* same element, neither should be a digit. */
if (index_start == index_final) {
assert(! ELEMENT_RANGE_MATCHES_INVLIST(index_start)
- || invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start+1]
- - invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start]
- == 10);
+ || (invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start+1]
+ - invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start]
+ == 10)
+ /* But actually Unicode did have one group of 11
+ * 'digits' in 5.2, so in case we are operating
+ * on that version, let that pass */
+ || (invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start+1]
+ - invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start]
+ == 11
+ && invlist_array(PL_XPosix_ptrs[_CC_DIGIT])[index_start]
+ == 0x19D0)
+ );
}
else if ((index_start >= 0
&& ELEMENT_RANGE_MATCHES_INVLIST(index_start))