Skip to content

Commit 59c3c99

Browse files
committed
Allocate enough fixed stack to keep preserved registers
1 parent f8e45ff commit 59c3c99

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ext/opcache/jit/ir

Submodule ir updated 1 file

ext/opcache/jit/zend_jit_ir.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
#endif
5353

5454
static size_t zend_jit_trace_prologue_size = (size_t)-1;
55+
#if defined(IR_TARGET_X86) || defined(IR_TARGET_X64)
5556
static uint32_t allowed_opt_flags = 0;
57+
#endif
5658
static bool delayed_call_chain = 0; // TODO: remove this var (use jit->delayed_call_level) ???
5759

5860
#ifdef ZTS
@@ -3341,7 +3343,11 @@ static void zend_jit_init_ctx(zend_jit_ctx *jit, uint32_t flags)
33413343
if (zend_jit_vm_kind == ZEND_VM_KIND_CALL) {
33423344
jit->ctx.flags |= IR_FUNCTION;
33433345
/* Stack must be 16 byte aligned */
3346+
#if defined(IR_TARGET_AARCH64)
3347+
jit->ctx.fixed_stack_frame_size = sizeof(void*) * 15; /* TODO: reduce stack size ??? */
3348+
#else
33443349
jit->ctx.fixed_stack_frame_size = sizeof(void*) * 7; /* TODO: reduce stack size ??? */
3350+
#endif
33453351
if (GCC_GLOBAL_REGS) {
33463352
jit->ctx.fixed_save_regset = IR_REGSET_PRESERVED & ~((1<<ZREG_FP) | (1<<ZREG_IP));
33473353
} else {

0 commit comments

Comments
 (0)