From 79908baed6d73d15f8ab8d9f37db0c1b889be70b Mon Sep 17 00:00:00 2001 From: jgmdev Date: Wed, 28 Dec 2022 19:40:20 -0400 Subject: [PATCH] regex: properly call pcre2_jit_compile --- src/api/regex.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api/regex.c b/src/api/regex.c index 4336827..f86e7ff 100644 --- a/src/api/regex.c +++ b/src/api/regex.c @@ -46,9 +46,7 @@ static pcre2_code* regex_get_pattern(lua_State *L, bool* should_free) { return NULL; } - if (pcre2_config(PCRE2_CONFIG_JIT, NULL) == 1) { - pcre2_jit_compile(re, PCRE2_JIT_COMPLETE); - } + pcre2_jit_compile(re, PCRE2_JIT_COMPLETE); *should_free = true; } @@ -159,6 +157,7 @@ static int f_pcre_compile(lua_State *L) { NULL ); if (re) { + pcre2_jit_compile(re, PCRE2_JIT_COMPLETE); lua_newtable(L); lua_pushlightuserdata(L, re); lua_rawseti(L, -2, 1);