Revision: 1218
http://vcs.pcre.org/viewvc?view=rev&revision=1218
Author: ph10
Date: 2012-11-11 17:27:22 +0000 (Sun, 11 Nov 2012)
Log Message:
-----------
Fix really stupid bug in multicase matching, and deficiency in the tests.
Modified Paths:
--------------
code/trunk/pcre_dfa_exec.c
code/trunk/pcre_exec.c
code/trunk/testdata/testinput10
code/trunk/testdata/testinput7
code/trunk/testdata/testoutput10
code/trunk/testdata/testoutput7
Modified: code/trunk/pcre_dfa_exec.c
===================================================================
--- code/trunk/pcre_dfa_exec.c 2012-11-09 17:07:01 UTC (rev 1217)
+++ code/trunk/pcre_dfa_exec.c 2012-11-11 17:27:22 UTC (rev 1218)
@@ -1112,7 +1112,7 @@
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[2];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
@@ -1356,7 +1356,7 @@
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[3];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
@@ -1594,7 +1594,7 @@
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[3];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
@@ -1857,7 +1857,7 @@
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + code[1 + IMM2_SIZE + 2];
for (;;)
{
if (c < *cp) { OK = FALSE; break; }
Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c 2012-11-09 17:07:01 UTC (rev 1217)
+++ code/trunk/pcre_exec.c 2012-11-11 17:27:22 UTC (rev 1218)
@@ -2594,7 +2594,7 @@
break;
case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + prop->caseset;
+ cp = PRIV(ucd_caseless_sets) + ecode[2];
for (;;)
{
if (c < *cp)
@@ -4214,7 +4214,7 @@
RRETURN(MATCH_NOMATCH);
}
GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);
+ cp = PRIV(ucd_caseless_sets) + prop_value;
for (;;)
{
if (c < *cp)
@@ -4965,7 +4965,7 @@
RRETURN(MATCH_NOMATCH);
}
GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);
+ cp = PRIV(ucd_caseless_sets) + prop_value;
for (;;)
{
if (c < *cp)
@@ -5457,7 +5457,7 @@
break;
}
GETCHARLENTEST(c, eptr, len);
- cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);
+ cp = PRIV(ucd_caseless_sets) + prop_value;
for (;;)
{
if (c < *cp)
Modified: code/trunk/testdata/testinput10
===================================================================
--- code/trunk/testdata/testinput10 2012-11-09 17:07:01 UTC (rev 1217)
+++ code/trunk/testdata/testinput10 2012-11-11 17:27:22 UTC (rev 1218)
@@ -1318,4 +1318,20 @@
/\x{017f}+/8i
\x{0053}\x{0073}\x{017f}
+/ist/8i
+ ikt
+
+/is+t/8i
+ iSs\x{17f}t
+ ikt
+
+/is+?t/8i
+ ikt
+
+/is?t/8i
+ ikt
+
+/is{2}t/8i
+ iskt
+
/-- End of testinput10 --/
Modified: code/trunk/testdata/testinput7
===================================================================
--- code/trunk/testdata/testinput7 2012-11-09 17:07:01 UTC (rev 1217)
+++ code/trunk/testdata/testinput7 2012-11-11 17:27:22 UTC (rev 1218)
@@ -653,4 +653,20 @@
/[^a]*\x{3c2}/8iBZ
+/ist/8iBZ
+ ikt
+
+/is+t/8i
+ iSs\x{17f}t
+ ikt
+
+/is+?t/8i
+ ikt
+
+/is?t/8i
+ ikt
+
+/is{2}t/8i
+ iskt
+
/-- End of testinput7 --/
Modified: code/trunk/testdata/testoutput10
===================================================================
--- code/trunk/testdata/testoutput10 2012-11-09 17:07:01 UTC (rev 1217)
+++ code/trunk/testdata/testoutput10 2012-11-11 17:27:22 UTC (rev 1218)
@@ -2701,4 +2701,26 @@
1: Ss
2: S
+/ist/8i
+ ikt
+No match
+
+/is+t/8i
+ iSs\x{17f}t
+ 0: iSs\x{17f}t
+ ikt
+No match
+
+/is+?t/8i
+ ikt
+No match
+
+/is?t/8i
+ ikt
+No match
+
+/is{2}t/8i
+ iskt
+No match
+
/-- End of testinput10 --/
Modified: code/trunk/testdata/testoutput7
===================================================================
--- code/trunk/testdata/testoutput7 2012-11-09 17:07:01 UTC (rev 1217)
+++ code/trunk/testdata/testoutput7 2012-11-11 17:27:22 UTC (rev 1218)
@@ -1440,4 +1440,34 @@
End
------------------------------------------------------------------
+/ist/8iBZ
+------------------------------------------------------------------
+ Bra
+ /i i
+ clist 0053 0073 017f
+ /i t
+ Ket
+ End
+------------------------------------------------------------------
+ ikt
+No match
+
+/is+t/8i
+ iSs\x{17f}t
+ 0: iSs\x{17f}t
+ ikt
+No match
+
+/is+?t/8i
+ ikt
+No match
+
+/is?t/8i
+ ikt
+No match
+
+/is{2}t/8i
+ iskt
+No match
+
/-- End of testinput7 --/