grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v3.1-14-gd069525


From: Paul Eggert
Subject: grep branch, master, updated. v3.1-14-gd069525
Date: Sat, 25 Nov 2017 23:10:11 -0500 (EST)

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  d069525b20e65ef86fb680ba830db634487f111e (commit)
      from  01fc34d2f121fb36bebe385ed9779e6b052f74b5 (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=d069525b20e65ef86fb680ba830db634487f111e


commit d069525b20e65ef86fb680ba830db634487f111e
Author: Paul Eggert <address@hidden>
Date:   Sat Nov 25 20:08:45 2017 -0800

    grep: port better to Adélie GNU/Linux 64-bit ppc
    
    Problem reported by A. Wilcox (Bug#29446).
    * src/pcresearch.c (PCRE_EXTRA_MATCH_LIMIT_RECURSION)
    (PCRE_STUDY_EXTRA_NEEDED): Default to 0.
    (jit_exec): If we run up against the recursion limit,
    double it (if possible) and try again.
    (Pcompile): Also specify PCRE_STUDY_EXTRA_NEEDED so that
    pc->extra is not null.

diff --git a/src/pcresearch.c b/src/pcresearch.c
index 43f91d0..96b7fc6 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -29,9 +29,15 @@
    in pcre_exec.  */
 enum { NSUB = 300 };
 
+# ifndef PCRE_EXTRA_MATCH_LIMIT_RECURSION
+#  define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0
+# endif
 # ifndef PCRE_STUDY_JIT_COMPILE
 #  define PCRE_STUDY_JIT_COMPILE 0
 # endif
+# ifndef PCRE_STUDY_EXTRA_NEEDED
+#  define PCRE_STUDY_EXTRA_NEEDED 0
+# endif
 
 struct pcre_comp
 {
@@ -83,6 +89,21 @@ jit_exec (struct pcre_comp *pc, char const *subject, int 
search_bytes,
         }
 # endif
 
+# 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)
+        {
+          pc->extra->match_limit_recursion *= 2;
+          if (pc->extra->match_limit_recursion == 0)
+            {
+              pc->extra->match_limit_recursion = (1 << 24) - 1;
+              pc->extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+            }
+          continue;
+        }
+# endif
+
       return e;
     }
 }
@@ -158,7 +179,8 @@ Pcompile (char *pattern, size_t size, reg_syntax_t ignored)
   if (!pc->cre)
     die (EXIT_TROUBLE, 0, "%s", ep);
 
-  pc->extra = pcre_study (pc->cre, PCRE_STUDY_JIT_COMPILE, &ep);
+  int pcre_study_flags = PCRE_STUDY_EXTRA_NEEDED | PCRE_STUDY_JIT_COMPILE;
+  pc->extra = pcre_study (pc->cre, pcre_study_flags, &ep);
   if (ep)
     die (EXIT_TROUBLE, 0, "%s", ep);
 

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

Summary of changes:
 src/pcresearch.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
grep



reply via email to

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