94da9193a6 ("grep: add support for PCRE v2", 2017-06-01) allocate
a stack and assign it to a match context, but never pass it to
pcre2_jit_match, using instead the default.

Signed-off-by: Carlo Marcelo Arenas Belón <care...@gmail.com>
---
This might have positive performance consequences (per the comments)
but haven't tested them; if there is no difference might be better
instead to remove the stack and match_context and save the related
memory, since it seems the default was working fine anyway.

 grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grep.c b/grep.c
index 146093f590..ff76907ceb 100644
--- a/grep.c
+++ b/grep.c
@@ -564,7 +564,7 @@ static int pcre2match(struct grep_pat *p, const char *line, 
const char *eol,
        if (p->pcre2_jit_on)
                ret = pcre2_jit_match(p->pcre2_pattern, (unsigned char *)line,
                                      eol - line, 0, flags, p->pcre2_match_data,
-                                     NULL);
+                                     p->pcre2_match_context);
        else
                ret = pcre2_match(p->pcre2_pattern, (unsigned char *)line,
                                  eol - line, 0, flags, p->pcre2_match_data,
-- 
2.22.0

Reply via email to