mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Prevent incorrect trasing JIT TSSA usage for range() result type inference
This commit is contained in:
@@ -55,7 +55,9 @@ typedef struct _func_info_t {
|
||||
static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa *ssa)
|
||||
{
|
||||
if (!call_info->send_unpack
|
||||
&& (call_info->num_args == 2 || call_info->num_args == 3)) {
|
||||
&& (call_info->num_args == 2 || call_info->num_args == 3)
|
||||
&& ssa
|
||||
&& !(ssa->cfg.flags & ZEND_SSA_TSSA)) {
|
||||
zend_op_array *op_array = call_info->caller_op_array;
|
||||
uint32_t t1 = _ssa_op1_info(op_array, ssa, call_info->arg_info[0].opline,
|
||||
&ssa->ops[call_info->arg_info[0].opline - op_array->opcodes]);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "zend_ssa.h"
|
||||
|
||||
/* func flags */
|
||||
/* func/cfg flags */
|
||||
#define ZEND_FUNC_INDIRECT_VAR_ACCESS (1<<0) /* accesses variables by name */
|
||||
#define ZEND_FUNC_HAS_CALLS (1<<1)
|
||||
#define ZEND_FUNC_VARARG (1<<2) /* uses func_get_args() */
|
||||
@@ -33,6 +33,7 @@
|
||||
#define ZEND_FUNC_RECURSIVE_INDIRECTLY (1<<9)
|
||||
#define ZEND_FUNC_HAS_EXTENDED_FCALL (1<<10)
|
||||
#define ZEND_FUNC_HAS_EXTENDED_STMT (1<<11)
|
||||
#define ZEND_SSA_TSSA (1<<12) /* used by tracing JIT */
|
||||
|
||||
typedef struct _zend_func_info zend_func_info;
|
||||
typedef struct _zend_call_info zend_call_info;
|
||||
|
||||
@@ -1060,6 +1060,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
|
||||
|
||||
/* 2. Construct TSSA */
|
||||
tssa = zend_arena_calloc(&CG(arena), 1, sizeof(zend_tssa));
|
||||
tssa->cfg.flags = ZEND_SSA_TSSA;
|
||||
tssa->cfg.blocks = zend_arena_calloc(&CG(arena), 2, sizeof(zend_basic_block));
|
||||
tssa->blocks = zend_arena_calloc(&CG(arena), 2, sizeof(zend_ssa_block));
|
||||
tssa->cfg.predecessors = zend_arena_calloc(&CG(arena), 2, sizeof(int));
|
||||
|
||||
Reference in New Issue
Block a user