You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-ripgrep/0001-pcre2-use-jit_if_avail...

30 lines
957 B

From eb18da04506b959c0251099eae83e16d22ce8bcb Mon Sep 17 00:00:00 2001
From: Andrew Gallant <jamslam@gmail.com>
Date: Sat, 8 Sep 2018 17:12:14 -0400
Subject: [PATCH] pcre2: use jit_if_available
This will allow PCRE2 to fall back to non-JIT matching when running on
platforms without JIT support.
ref https://github.com/BurntSushi/rust-pcre2/issues/3
---
src/args.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/args.rs b/src/args.rs
index 1a38d3e..7aed914 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -633,7 +633,7 @@ impl ArgMatches {
// For whatever reason, the JIT craps out during regex compilation with
// a "no more memory" error on 32 bit systems. So don't use it there.
if !cfg!(target_pointer_width = "32") {
- builder.jit(true);
+ builder.jit_if_available(true);
}
if self.pcre2_unicode() {
builder.utf(true).ucp(true);
--
2.19.0.rc1