@@ -310,7 +310,7 @@ typedef struct _zend_jit_registers_buf {
310310#define ZEND_JIT_EXIT_POINTS_SPACING 4 // push byte + short jmp = bytes
311311#define ZEND_JIT_EXIT_POINTS_PER_GROUP 32 // number of continuous exit points
312312
313- static uint32_t zend_jit_exit_point_by_addr(void *addr);
313+ static uint32_t zend_jit_exit_point_by_addr(const void *addr);
314314int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf *regs);
315315
316316static int zend_jit_assign_to_variable(zend_jit_ctx *jit,
@@ -358,7 +358,7 @@ static const void *zend_jit_get_veneer(ir_ctx *ctx, const void *addr)
358358
359359 if (((zend_jit_ctx*)ctx)->trace
360360 && (void*)addr >= dasm_buf && (void*)addr < dasm_end) {
361- uint32_t exit_point = zend_jit_exit_point_by_addr((void*) addr);
361+ uint32_t exit_point = zend_jit_exit_point_by_addr(addr);
362362
363363 if (exit_point != (uint32_t)-1) {
364364 zend_jit_trace_info *t = ((zend_jit_ctx*)ctx)->trace;
@@ -375,7 +375,11 @@ static bool zend_jit_set_veneer(ir_ctx *ctx, const void *addr, const void *venee
375375{
376376 int i, count = sizeof(zend_jit_stubs) / sizeof(zend_jit_stubs[0]);
377377 int64_t offset;
378+ uint32_t exit_point = zend_jit_exit_point_by_addr(addr);
378379
380+ if (exit_point != (uint32_t)-1) {
381+ return 1;
382+ }
379383 for (i = 0; i < count; i++) {
380384 if (zend_jit_stub_handlers[i] == addr) {
381385 const void **ptr = (const void**)&zend_jit_stub_handlers[count + i];
0 commit comments