[Pcre-svn] [681] code/trunk: Fix loop/bad error when recurse…

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [681] code/trunk: Fix loop/bad error when recursed group contains (*PRUNE) etc.
Revision: 681
          http://vcs.pcre.org/viewvc?view=rev&revision=681
Author:   ph10
Date:     2011-09-06 10:16:32 +0100 (Tue, 06 Sep 2011)


Log Message:
-----------
Fix loop/bad error when recursed group contains (*PRUNE) etc.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_exec.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2011-09-06 09:15:54 UTC (rev 680)
+++ code/trunk/ChangeLog    2011-09-06 09:16:32 UTC (rev 681)
@@ -28,6 +28,16 @@


 4. Zoltan Herczeg's just-in-time compiler support has been integrated into the
    main code base, and can be used by building with --enable-jit. 
+   
+5. When the number of matches in a pcre_dfa_exec() run exactly filled the 
+   ovector, the return from the function was zero, implying that there were 
+   other matches that did not fit. The correct "exactly full" value is now 
+   returned. 
+   
+6. If a subpattern that was called recursively or as a subroutine contained
+   (*PRUNE) or any other control that caused it to give a non-standard return, 
+   invalid errors such as "Error -26 (nested recursion at the same subject 
+   position)" or even infinite loops could occur. 



Version 8.13 16-Aug-2011

Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c    2011-09-06 09:15:54 UTC (rev 680)
+++ code/trunk/pcre_exec.c    2011-09-06 09:16:32 UTC (rev 681)
@@ -1556,10 +1556,10 @@
           md, eptrb, RM6);
         memcpy(md->offset_vector, new_recursive.offset_save,
             new_recursive.saved_max * sizeof(int));
+        md->recursive = new_recursive.prevrec;
         if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)
           {
           DPRINTF(("Recursion matched\n"));
-          md->recursive = new_recursive.prevrec;
           if (new_recursive.offset_save != stacksave)
             (pcre_free)(new_recursive.offset_save);