diff options
author | Charles Bailey <cbailey32@bloomberg.net> | 2017-11-12 16:59:38 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-13 12:49:53 +0900 |
commit | 2fff1e196d9cf03a868e99da39ea21b7c18c65c5 (patch) | |
tree | a8d0d8ec11dfcdc8f8c125f845cab21b93893531 /grep.c | |
parent | grep: fix erroneously copy/pasted variable in check/assert pattern (diff) | |
download | tgif-2fff1e196d9cf03a868e99da39ea21b7c18c65c5.tar.xz |
grep: fix NO_LIBPCRE1_JIT to fully disable JIT
If you have a pcre1 library which is compiled with JIT enabled then
PCRE_STUDY_JIT_COMPILE will be defined whether or not the
NO_LIBPCRE1_JIT configuration is set.
This means that we enable JIT functionality when calling pcre_study
even if NO_LIBPCRE1_JIT has been explicitly set and we just use plain
pcre_exec later.
Fix this by using own macro (GIT_PCRE_STUDY_JIT_COMPILE) which we set to
PCRE_STUDY_JIT_COMPILE only if NO_LIBPCRE1_JIT is not set and define to
0 otherwise, as before.
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -380,7 +380,7 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt) if (!p->pcre1_regexp) compile_regexp_failed(p, error); - p->pcre1_extra_info = pcre_study(p->pcre1_regexp, PCRE_STUDY_JIT_COMPILE, &error); + p->pcre1_extra_info = pcre_study(p->pcre1_regexp, GIT_PCRE_STUDY_JIT_COMPILE, &error); if (!p->pcre1_extra_info && error) die("%s", error); |