Skip to content

Commit 32052e7

Browse files
committed
Fixed support for possible indirect variable modification (ext/standard/tests/array/bug77135.phpt failure).
1 parent afc93e4 commit 32052e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4585,14 +4585,22 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
45854585
if (p->func) {
45864586
if (p->func->type == ZEND_USER_FUNCTION) {
45874587
if (JIT_G(opt_level) >= ZEND_JIT_LEVEL_INLINE) {
4588+
zend_jit_op_array_trace_extension *jit_extension =
4589+
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(p->op_array);
4590+
zend_ssa *op_array_ssa = &jit_extension->func_info.ssa;
4591+
45884592
i = 0;
45894593
while (i < p->op_array->num_args) {
45904594
/* Types of arguments are going to be stored in abstract stack when processing SEV instruction */
45914595
SET_STACK_TYPE(call->stack, i, IS_UNKNOWN);
45924596
i++;
45934597
}
45944598
while (i < p->op_array->last_var) {
4595-
SET_STACK_TYPE(call->stack, i, IS_UNDEF);
4599+
if (zend_jit_var_may_be_modified_indirectly(p->op_array, op_array_ssa, i)) {
4600+
SET_STACK_TYPE(call->stack, i, IS_UNKNOWN);
4601+
} else {
4602+
SET_STACK_TYPE(call->stack, i, IS_UNDEF);
4603+
}
45964604
i++;
45974605
}
45984606
while (i < p->op_array->last_var + p->op_array->T) {

0 commit comments

Comments
 (0)