summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2020-11-05 18:32:00 +0300
committerDmitry Stogov <dmitry@zend.com>2020-11-05 18:32:00 +0300
commitff91800602930953d1a4533127e9807541e7d759 (patch)
treebcde66cd4b51a2649d10f9411df9bf2af5e9434d
parent2effbfd8713936742ef46e6e85ce193b320ac005 (diff)
downloadphp-git-ff91800602930953d1a4533127e9807541e7d759.tar.gz
Fixed incorrect invariant guard motion
-rw-r--r--ext/opcache/jit/zend_jit_trace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c
index 7e053f5cda..27362312e5 100644
--- a/ext/opcache/jit/zend_jit_trace.c
+++ b/ext/opcache/jit/zend_jit_trace.c
@@ -3488,7 +3488,9 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
} else if ((info & MAY_BE_GUARD) != 0
&& (trace_buffer->stop == ZEND_JIT_TRACE_STOP_LOOP
|| trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_CALL
- || trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_RET)
+ || (trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_RET
+ && (opline-1)->result_type == IS_VAR
+ && EX_VAR_TO_NUM((opline-1)->result.var) == i))
&& (ssa->vars[i].use_chain != -1
|| (ssa->vars[i].phi_use_chain
&& !(ssa->var_info[ssa->vars[i].phi_use_chain->ssa_var].type & MAY_BE_GUARD)))) {