Skip to content

Commit bf7a1c3

Browse files
committed
Fix JIT stack setup on aarch64/clang
1 parent dee0042 commit bf7a1c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,15 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
27332733
/* Stack must be 16 byte aligned */
27342734
/* TODO: select stack size ??? */
27352735
#if ZEND_VM_KIND == ZEND_VM_KIND_TAILCALL
2736+
# if defined(IR_TARGET_AARCH64)
2737+
/* Must save LR */
2738+
jit->ctx.flags |= IR_USE_FRAME_POINTER;
2739+
/* Same as HYBRID VM */
2740+
jit->ctx.fixed_stack_frame_size = sizeof(void*) * 4; /* 4 spill slots (8 bytes) or 8 spill slots (4 bytes) */
2741+
# else
2742+
/* Same as HYBRID VM, plus 1 slot for re-alignment (caller pushes return address, frame is not aligned on entry) */
27362743
jit->ctx.fixed_stack_frame_size = sizeof(void*) * 5; /* 5 spill slots (8 bytes) or 10 spill slots (4 bytes) */
2744+
# endif
27372745
#elif defined(IR_TARGET_AARCH64)
27382746
jit->ctx.flags |= IR_USE_FRAME_POINTER;
27392747
jit->ctx.fixed_stack_frame_size = sizeof(void*) * 16; /* 10 saved registers and 6 spill slots (8 bytes) */

0 commit comments

Comments
 (0)