[pcre-dev] How am I supposed to use PCRE2 JIT in the face of…

Página Inicial
Delete this message
Autor: Ævar Arnfjörð Bjarmason
Data:  
Para: pcre-dev
Assunto: [pcre-dev] How am I supposed to use PCRE2 JIT in the face of (*NO_JIT) ?
I'm doing the following:

1. pcre2_compile
2. pcre2_config(...CONFIG_JIT
3. pcre2_pattern_info(...INFO_JITSIZE...)

Then if the JIT is on according to the pcre2_config() return value,
call pcre2_jit_match() later instead of pcre2_match() (and earlier
jit_compile, jit stack etc.).

The problem is that if the pattern has (*NO_JIT) in it calling
pcre2_jit_match() will segfault, which I get, it says "no JIT" so
presumably some internal thing didn't compile the appropriate
structures.

But I can't find any way to figure out from pcre2_config() or anything
else whether the string I just compiled contains (*NO_JIT). Is there
such an API, or do I need to do a string match against the pattern
itself?