Skip to content

Commit f4b821b

Browse files
committed
jit: fix pcre2_jit_free_unused_memory() if sljit not using allocator
sljit allows building without an internal allocator, but instead using an external one. make sure to only invoke the corresponding sljit call if an internal allocator is in use (the default and as coded in pcre integration) to avoid problems if the code is changed to use an external allocator instead.
1 parent f1e48eb commit f4b821b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pcre2_jit_misc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ pcre2_jit_free_unused_memory(pcre2_general_context *gcontext)
110110
(void)gcontext; /* Suppress warning */
111111
#else /* SUPPORT_JIT */
112112
SLJIT_UNUSED_ARG(gcontext);
113+
#if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
113114
sljit_free_unused_memory_exec();
114-
#endif /* SUPPORT_JIT */
115+
#endif /* SLJIT_EXECUTABLE_ALLOCATOR */
116+
#endif /* SUPPORT_JIT */
115117
}
116118

117119

0 commit comments

Comments
 (0)