Skip to content

gregex: clean up usage of _GRegex.jit_status

This makes sure that _Gregex.jit_status is consistently set, which ensures that the correct code path is used when multiple JIT-enabled regexes are called but the JIT fails.

!3530 (merged) changed the way the JIT was initialised to only do so on demand rather than in g_regex_new. Unfortunately, this meant that regex->jit_status was never being set, which broke some of the other logic.

The final result was that after the first comparison the JIT_STATUS from enable_jit_with_match_options was usually reported as JIT_STATUS_DEFAULT, since old_jit_options == new_jit_options and the theoretically cached value was returned. Interestingly, this usually wasn't a problem, since the ordinary pcre2_match uses the JIT if it's enabled... except in the case where the JIT was failing, in which case the fallback introduced in !3545 (merged) wasn't used.

Closes #2824 (closed)

Merge request reports