Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

mac-aarch64: PCRE2_INFO_JITSIZE > 0 while CONFIG_JIT = 0?

27 views
Skip to first unread message

Alexey Pelykh

unread,
Jun 26, 2024, 4:25:51 PM6/26/24
to PCRE2 discussion list
Greetings to all,

I've encountered a rather bizarre behavior of /usr/lib/libpcre2-8.dylib on mac-aarch64 when the PCRE2_INFO_JITSIZE for a pcre2_compile'd pattern has PCRE2_INFO_JITSIZE > 0 while it was never processed with pcre2_jit_compile and CONFIG_JIT for that library. The library reports it's 10.42

Is this something known?

P.S. libpcre2 distributed by homebrew behaves as expected.

Kind regards,
Alexey

Philip Hazel

unread,
Jun 28, 2024, 10:15:21 AM6/28/24
to Alexey Pelykh, PCRE2 discussion list
What was your call to pcre2_pattern_info()? If it was pcre2_pattern_info(pattern, PCRE2_INFO_JITSIZE, NULL) you will get a non-zero result, because when the third argument is NULL the value returned is the size of the variable needed for that particular data item. Even if PCRE2 was compiled without JIT support, it is still happy to tell you how big a variable would be required to hold the JIT size data. I suppose this could be changed to give an error return - there doesn't seem to be an existing "JIT not supported" error, but one could be invented. Is is worth it?

If your third argument was not NULL, I am bewildered, because the code explicitly returns zero when JIT is not supported. 

Regards,
Philip


--
You received this message because you are subscribed to the Google Groups "PCRE2 discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pcre2-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pcre2-dev/bcf4ef97-728e-463e-a571-7966c63ab5b5n%40googlegroups.com.

Alexey Pelykh

unread,
Jul 2, 2024, 11:15:48 AM7/2/24
to Philip Hazel, PCRE2 discussion list
Well, I should be ashamed of myself - there surely was a mistake in my code, yet even more dumber: JITSIZE <> FRAMESIZE mixup in one line.

Sorry for the annoyance 
Reply all
Reply to author
Forward
0 new messages