Skip to content

Commit

Permalink
regex: properly call pcre2_jit_compile
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmdev committed Dec 28, 2022
1 parent 74349f8 commit 79908ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/api/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 79908ba

Please sign in to comment.