grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v3.3-87-g669a52e


From: Paul Eggert
Subject: grep branch, master, updated. v3.3-87-g669a52e
Date: Wed, 9 Sep 2020 19:01:02 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  669a52ea60220bad4f72b06f5d200dbe729ea500 (commit)
       via  68dddcfd25715d14d8052833d6d6a84d277953b7 (commit)
      from  de6f36d9b6d702b14ac4ee58dfbcab740c7ca749 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=669a52ea60220bad4f72b06f5d200dbe729ea500


commit 669a52ea60220bad4f72b06f5d200dbe729ea500
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Wed Sep 9 15:07:01 2020 -0700

    grep: fix logic for growing PCRE JIT stack
    
    * src/pcresearch.c (jit_exec) [PCRE_EXTRA_MATCH_LIMIT_RECURSION]:
    When growing the match_limit_recursion limit, do not use the old
    value if ! (flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION), as it is
    uninitialized in that case.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index e265083..a668c45 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -90,16 +90,18 @@ jit_exec (struct pcre_comp *pc, char const *subject, int 
search_bytes,
 
 #if PCRE_EXTRA_MATCH_LIMIT_RECURSION
       if (e == PCRE_ERROR_RECURSIONLIMIT
-          && (PCRE_STUDY_EXTRA_NEEDED || pc->extra)
-          && pc->extra->match_limit_recursion <= ULONG_MAX / 2)
+          && (PCRE_STUDY_EXTRA_NEEDED || pc->extra))
         {
-          pc->extra->match_limit_recursion *= 2;
-          if (pc->extra->match_limit_recursion == 0)
+          unsigned long lim
+            = (pc->extra->flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION
+               ? pc->extra->match_limit_recursion
+               : 0);
+          if (lim <= ULONG_MAX / 2)
             {
-              pc->extra->match_limit_recursion = (1 << 24) - 1;
+              pc->extra->match_limit_recursion = lim ? 2 * lim : (1 << 24) - 1;
               pc->extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+              continue;
             }
-          continue;
         }
 #endif
 

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=68dddcfd25715d14d8052833d6d6a84d277953b7


commit 669a52ea60220bad4f72b06f5d200dbe729ea500
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Wed Sep 9 15:07:01 2020 -0700

    grep: fix logic for growing PCRE JIT stack
    
    * src/pcresearch.c (jit_exec) [PCRE_EXTRA_MATCH_LIMIT_RECURSION]:
    When growing the match_limit_recursion limit, do not use the old
    value if ! (flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION), as it is
    uninitialized in that case.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index e265083..a668c45 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -90,16 +90,18 @@ jit_exec (struct pcre_comp *pc, char const *subject, int 
search_bytes,
 
 #if PCRE_EXTRA_MATCH_LIMIT_RECURSION
       if (e == PCRE_ERROR_RECURSIONLIMIT
-          && (PCRE_STUDY_EXTRA_NEEDED || pc->extra)
-          && pc->extra->match_limit_recursion <= ULONG_MAX / 2)
+          && (PCRE_STUDY_EXTRA_NEEDED || pc->extra))
         {
-          pc->extra->match_limit_recursion *= 2;
-          if (pc->extra->match_limit_recursion == 0)
+          unsigned long lim
+            = (pc->extra->flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION
+               ? pc->extra->match_limit_recursion
+               : 0);
+          if (lim <= ULONG_MAX / 2)
             {
-              pc->extra->match_limit_recursion = (1 << 24) - 1;
+              pc->extra->match_limit_recursion = lim ? 2 * lim : (1 << 24) - 1;
               pc->extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+              continue;
             }
-          continue;
         }
 #endif
 

-----------------------------------------------------------------------

Summary of changes:
 src/pcresearch.c    | 17 +++++++++++------
 tests/pcre-jitstack |  3 ++-
 2 files changed, 13 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]