[Pcre-svn] [415] code/trunk: Fix (*NO_AUTO_POSSESS)

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [415] code/trunk: Fix (*NO_AUTO_POSSESS)
Revision: 415
          http://www.exim.org/viewvc/pcre2?view=rev&revision=415
Author:   ph10
Date:     2015-11-05 18:03:16 +0000 (Thu, 05 Nov 2015)
Log Message:
-----------
Fix (*NO_AUTO_POSSESS)


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2_compile.c
    code/trunk/testdata/testinput15
    code/trunk/testdata/testoutput15
    code/trunk/testdata/testoutput2


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2015-11-05 17:33:39 UTC (rev 414)
+++ code/trunk/ChangeLog    2015-11-05 18:03:16 UTC (rev 415)
@@ -266,7 +266,9 @@
 77. Implement pcre2_set_max_pattern_length() so that programs can restrict the
 size of patterns that they are prepared to handle.


+78. (*NO_AUTO_POSSESS) was not working.

+
Version 10.20 30-June-2015
--------------------------


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2015-11-05 17:33:39 UTC (rev 414)
+++ code/trunk/src/pcre2_compile.c    2015-11-05 18:03:16 UTC (rev 415)
@@ -8599,7 +8599,7 @@
 if (errorcode == 0)
   {
   if (re->top_backref > re->top_bracket) errorcode = ERR15;
-  else if ((options & PCRE2_NO_AUTO_POSSESS) == 0)
+  else if ((re->overall_options & PCRE2_NO_AUTO_POSSESS) == 0)
     {
     PCRE2_UCHAR *temp = (PCRE2_UCHAR *)codestart;
     if (PRIV(auto_possessify)(temp, utf, &cb) != 0) errorcode = ERR80;


Modified: code/trunk/testdata/testinput15
===================================================================
--- code/trunk/testdata/testinput15    2015-11-05 17:33:39 UTC (rev 414)
+++ code/trunk/testdata/testinput15    2015-11-05 18:03:16 UTC (rev 415)
@@ -151,5 +151,13 @@


 /[^\xff]((?1))/BI
     abcd
+    
+# These tests don't behave the same with JIT 


+/\w+(?C1)/BI,no_auto_possess
+    abc\=callout_fail=1
+
+/(*NO_AUTO_POSSESS)\w+(?C1)/BI
+    abc\=callout_fail=1
+
 # End of testinput15


Modified: code/trunk/testdata/testoutput15
===================================================================
--- code/trunk/testdata/testoutput15    2015-11-05 17:33:39 UTC (rev 414)
+++ code/trunk/testdata/testoutput15    2015-11-05 18:03:16 UTC (rev 415)
@@ -330,5 +330,54 @@
 Subject length lower bound = 1
     abcd
 Failed: error -52: nested recursion at the same subject position
+    
+# These tests don't behave the same with JIT 


+/\w+(?C1)/BI,no_auto_possess
+------------------------------------------------------------------
+        Bra
+        \w+
+        Callout 1 8 0
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Options: no_auto_possess
+Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
+  Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 
+Subject length lower bound = 1
+    abc\=callout_fail=1
+--->abc
+  1 ^  ^    
+  1 ^ ^     
+  1 ^^      
+  1  ^ ^    
+  1  ^^     
+  1   ^^    
+No match
+
+/(*NO_AUTO_POSSESS)\w+(?C1)/BI
+------------------------------------------------------------------
+        Bra
+        \w+
+        Callout 1 26 0
+        Ket
+        End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+Compile options: <none>
+Overall options: no_auto_possess
+Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
+  Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 
+Subject length lower bound = 1
+    abc\=callout_fail=1
+--->abc
+  1 ^  ^    
+  1 ^ ^     
+  1 ^^      
+  1  ^ ^    
+  1  ^^     
+  1   ^^    
+No match
+
 # End of testinput15


Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2    2015-11-05 17:33:39 UTC (rev 414)
+++ code/trunk/testdata/testoutput2    2015-11-05 18:03:16 UTC (rev 415)
@@ -8830,7 +8830,7 @@
 /(*NO_AUTO_POSSESS)a+b/B
 ------------------------------------------------------------------
         Bra
-        a++
+        a+
         b
         Ket
         End