@@ -374,6 +374,7 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt)
374374 const char * error ;
375375 int erroffset ;
376376 int options = PCRE_MULTILINE ;
377+ int study_options = 0 ;
377378
378379 if (opt -> ignore_case ) {
379380 if (!opt -> ignore_locale && has_non_ascii (p -> pattern ))
@@ -388,15 +389,18 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt)
388389 if (!p -> pcre1_regexp )
389390 compile_regexp_failed (p , error );
390391
391- p -> pcre1_extra_info = pcre_study (p -> pcre1_regexp , GIT_PCRE_STUDY_JIT_COMPILE , & error );
392- if (!p -> pcre1_extra_info && error )
393- die ("%s" , error );
394-
395- #ifdef GIT_PCRE1_USE_JIT
392+ #if defined(PCRE_CONFIG_JIT ) && !defined(NO_LIBPCRE1_JIT )
396393 pcre_config (PCRE_CONFIG_JIT , & p -> pcre1_jit_on );
397394 if (opt -> debug )
398395 fprintf (stderr , "pcre1_jit_on=%d\n" , p -> pcre1_jit_on );
396+
397+ if (p -> pcre1_jit_on )
398+ study_options = PCRE_STUDY_JIT_COMPILE ;
399399#endif
400+
401+ p -> pcre1_extra_info = pcre_study (p -> pcre1_regexp , study_options , & error );
402+ if (!p -> pcre1_extra_info && error )
403+ die ("%s" , error );
400404}
401405
402406static int pcre1match (struct grep_pat * p , const char * line , const char * eol ,
@@ -425,7 +429,7 @@ static int pcre1match(struct grep_pat *p, const char *line, const char *eol,
425429static void free_pcre1_regexp (struct grep_pat * p )
426430{
427431 pcre_free (p -> pcre1_regexp );
428- #ifdef GIT_PCRE1_USE_JIT
432+ #ifdef PCRE_CONFIG_JIT
429433 if (p -> pcre1_jit_on )
430434 pcre_free_study (p -> pcre1_extra_info );
431435 else
0 commit comments