Re: [pcre-dev] pcre2_jit_match(): match context needed?

Page principale
Supprimer ce message
Auteur: Zoltán Herczeg
Date:  
À: Ralf Junker
CC: pcre-dev@exim.org
Sujet: Re: [pcre-dev] pcre2_jit_match(): match context needed?
Hi,

this was simply an oversight from my side (after some refactoring). The mcontext can be NULL. Thank you for noticing it. I hope I fixed it.

Regards,
Zoltan

Ralf Junker <ralfjunker@???> írta:
>PCRE2 pcre2jit.html:
>
>"The fast path function is called pcre2_jit_match(), and it takes
>exactly the same arguments as pcre2_match()."
>
> From this I concluded that I can use pcre2_jit_match() exactly as
>pcre2_match(), provided that I previously called pcre2_jit_compile().
>
>I hence called pcre2_jit_match() without providing a match context. As a
>result, I received an AV.
>
>Creating a match context and passing it to pcre2_jit_match() solved the
>problem.
>
>I wondered if pcre2_jit_match() indeed needs a match context, but the
>"JIT FAST PATH API" section does not mention it.
>
>pcre2_jit_match.c is not clear either: line 136 tests "if (mcontext !=
>NULL)" whereas line 159 de-references mcontext without prior testing -
>which leads to the AV described above.
>
>If pcre2_jit_match() indeed needs a match context, should it not return
>an error if missing (i.e. PCRE2_ERROR_JIT_BADOPTION) instead of raising
>an AV?
>
>Ralf
>
>--
>## List details at https://lists.exim.org/mailman/listinfo/pcre-dev
>