From eda9d7ac22c70f75a44bf33139acf8c812d69944 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 9 Nov 2021 00:55:40 +0300 Subject: [PATCH] Tracing JIT: Fixed missed type store in deoptimization code --- ext/opcache/jit/zend_jit_trace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 397aa889789..6494b76dff0 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -3495,14 +3495,14 @@ static int zend_jit_trace_deoptimization(dasm_State **Dst, } else { uint8_t type = STACK_TYPE(parent_stack, i); - if (stack) { - SET_STACK_TYPE(stack, i, type, 1); - } if (!(STACK_FLAGS(parent_stack, i) & (ZREG_LOAD|ZREG_STORE)) && !zend_jit_store_var(Dst, 1 << type, i, reg, STACK_MEM_TYPE(parent_stack, i) != type)) { return 0; } + if (stack) { + SET_STACK_TYPE(stack, i, type, 1); + } } } else { /* delay custom deoptimization instructions to prevent register clobbering */