diff --git a/src/pcre2_jit_match.c b/src/pcre2_jit_match.c index 2f59031..62c5ac6 100644 --- a/src/pcre2_jit_match.c +++ b/src/pcre2_jit_match.c @@ -44,7 +44,7 @@ POSSIBILITY OF SUCH DAMAGE. #ifdef SUPPORT_JIT -static int jit_machine_stack_exec(jit_arguments *arguments, jit_function executable_func) +static SLJIT_NOINLINE int jit_machine_stack_exec(jit_arguments *arguments, jit_function executable_func) { sljit_ub local_space[MACHINE_STACK_SIZE]; struct sljit_stack local_stack; diff --git a/src/sljit/sljitConfigInternal.h b/src/sljit/sljitConfigInternal.h index 01a5329..3284012 100644 --- a/src/sljit/sljitConfigInternal.h +++ b/src/sljit/sljitConfigInternal.h @@ -243,6 +243,15 @@ #endif #endif /* !SLJIT_INLINE */ +#ifndef SLJIT_NOINLINE +/* Not inline functions. */ +#if defined(__GNUC__) +#define SLJIT_NOINLINE __attribute__ ((noinline)) +#else +#define SLJIT_NOINLINE +#endif +#endif /* !SLJIT_INLINE */ + #ifndef SLJIT_CONST /* Const variables. */ #define SLJIT_CONST const diff --git a/src/sljit/sljitLir.c b/src/sljit/sljitLir.c index f0b3947..8112e8d 100644 --- a/src/sljit/sljitLir.c +++ b/src/sljit/sljitLir.c @@ -1325,6 +1325,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_jump(struct sljit_compile CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_INT_OP))); CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_CALL3); CHECK_ARGUMENT((type & 0xff) < SLJIT_JUMP || !(type & SLJIT_INT_OP)); + CHECK_ARGUMENT((type & 0xff) <= SLJIT_CALL0 || ((type & 0xff) - SLJIT_CALL0) <= compiler->scratches); #endif #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) if (SLJIT_UNLIKELY(!!compiler->verbose)) @@ -1390,6 +1391,7 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_ijump(struct sljit_compil #if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS) CHECK_ARGUMENT(type >= SLJIT_JUMP && type <= SLJIT_CALL3); + CHECK_ARGUMENT(type <= SLJIT_CALL0 || (type - SLJIT_CALL0) <= compiler->scratches); FUNCTION_CHECK_SRC(src, srcw); #endif #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) diff --git a/src/sljit/sljitUtils.c b/src/sljit/sljitUtils.c index 3f12bb7..5294b5f 100644 --- a/src/sljit/sljitUtils.c +++ b/src/sljit/sljitUtils.c @@ -211,6 +211,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj SYSTEM_INFO si; #endif + SLJIT_UNUSED_ARG(allocator_data); if (limit > max_limit || limit < 1) return NULL; @@ -239,14 +240,14 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj #ifdef _WIN32 base.ptr = VirtualAlloc(NULL, max_limit, MEM_RESERVE, PAGE_READWRITE); if (!base.ptr) { - SLJIT_FREE(stack); + SLJIT_FREE(stack, allocator_data); return NULL; } stack->base = base.uw; stack->limit = stack->base; stack->max_limit = stack->base + max_limit; if (sljit_stack_resize(stack, stack->base + limit)) { - sljit_free_stack(stack); + sljit_free_stack(stack, allocator_data); return NULL; } #else @@ -255,7 +256,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj #else if (dev_zero < 0) { if (open_dev_zero()) { - SLJIT_FREE(stack); + SLJIT_FREE(stack, allocator_data); return NULL; } } @@ -277,6 +278,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_stack* SLJIT_CALL sljit_allocate_stack(slj SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_free_stack(struct sljit_stack* stack, void *allocator_data) { + SLJIT_UNUSED_ARG(allocator_data); #ifdef _WIN32 VirtualFree((void*)stack->base, 0, MEM_RELEASE); #else