From 3071c56699e6a52355bb59a16e1d309f92d749e6 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 19 Mar 2015 21:49:30 -0600 Subject: [PATCH] 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. --- regcomp.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/regcomp.c b/regcomp.c index 51065d5..8c3dffd 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)) -- 1.8.3.1