From 32052e74702aa27aacffa871aa1ff812e9f00c15 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 17 Aug 2020 22:31:03 +0300 Subject: [PATCH] Fixed support for possible indirect variable modification (ext/standard/tests/array/bug77135.phpt failure). --- ext/opcache/jit/zend_jit_trace.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 0d2e187f0d..d86e1d10b9 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -4585,6 +4585,10 @@ done: if (p->func) { if (p->func->type == ZEND_USER_FUNCTION) { if (JIT_G(opt_level) >= ZEND_JIT_LEVEL_INLINE) { + zend_jit_op_array_trace_extension *jit_extension = + (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(p->op_array); + zend_ssa *op_array_ssa = &jit_extension->func_info.ssa; + i = 0; while (i < p->op_array->num_args) { /* Types of arguments are going to be stored in abstract stack when processing SEV instruction */ @@ -4592,7 +4596,11 @@ done: i++; } while (i < p->op_array->last_var) { - SET_STACK_TYPE(call->stack, i, IS_UNDEF); + if (zend_jit_var_may_be_modified_indirectly(p->op_array, op_array_ssa, i)) { + SET_STACK_TYPE(call->stack, i, IS_UNKNOWN); + } else { + SET_STACK_TYPE(call->stack, i, IS_UNDEF); + } i++; } while (i < p->op_array->last_var + p->op_array->T) { -- 2.50.1