From 48ae025c33b7fd0f011a70d4e418c0f5f40d1a68 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 28 May 2024 08:37:20 +0300 Subject: [PATCH] Fix incorrect conditions --- ext/opcache/jit/zend_jit_trace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index c1ed5d80a66..ec63ea38c25 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2205,7 +2205,7 @@ propagate_arg: assert(0); } if (opline->opcode == ZEND_ASSIGN_DIM_OP - && ssa_ops[idx].op1_def > 0 + && ssa_ops[idx].op1_def >= 0 && op1_type == IS_ARRAY && (orig_op1_type & IS_TRACE_PACKED) && val_type != IS_UNKNOWN @@ -5033,7 +5033,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info))) { goto jit_failure; } - if (ssa_op->op2_def > 0 + if (ssa_op->op2_def >= 0 && Z_MODE(op2_addr) == IS_REG && ssa->vars[ssa_op->op2_def].no_val) { uint8_t type = (op2_info & MAY_BE_LONG) ? IS_LONG : IS_DOUBLE; @@ -5083,7 +5083,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par res_use_info, res_info, res_addr)) { goto jit_failure; } - if (ssa_op->op1_def > 0 + if (ssa_op->op1_def >= 0 && Z_MODE(op1_addr) == IS_REG && ssa->vars[ssa_op->op1_def].no_val) { uint8_t type = (op1_info & MAY_BE_LONG) ? IS_LONG : IS_DOUBLE; @@ -5180,7 +5180,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par op1_info, op1_addr, op1_def_addr)) { goto jit_failure; } - if (ssa_op->op1_def > 0 + if (ssa_op->op1_def >= 0 && Z_MODE(op1_addr) == IS_REG && ssa->vars[ssa_op->op1_def].no_val) { uint8_t type = (op1_info & MAY_BE_LONG) ? IS_LONG : IS_DOUBLE; @@ -5730,7 +5730,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par op1_info, op1_addr, op2_info, RES_REG_ADDR(), val_type)) { goto jit_failure; } - if (ssa_op->result_def > 0 + if (ssa_op->result_def >= 0 && (opline->opcode == ZEND_FETCH_DIM_W || opline->opcode == ZEND_FETCH_LIST_W) && !(op1_info & (MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT))) {