Skip to content

Commit bd329a6

Browse files
committed
Keep information about SEND_UNPACK/SEND_ARRAY in call_info
1 parent d2d5738 commit bd329a6

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
18411841
}
18421842

18431843
/* We're only interested in functions with up to three arguments right now */
1844-
if (call->num_args > 3) {
1844+
if (call->num_args > 3 || call->send_unpack) {
18451845
SET_RESULT_BOT(result);
18461846
break;
18471847
}

ext/opcache/Optimizer/zend_call_graph.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ int zend_analyze_calls(zend_arena **arena, zend_script *script, uint32_t build_f
136136
break;
137137
case ZEND_SEND_ARRAY:
138138
case ZEND_SEND_UNPACK:
139-
/* TODO: set info about var_arg call ??? */
140139
if (call_info) {
141-
call_info->num_args = -1;
140+
call_info->send_unpack = 1;
142141
}
143142
break;
144143
case ZEND_EXIT:

ext/opcache/Optimizer/zend_call_graph.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ struct _zend_call_info {
4040
zend_call_info *next_caller;
4141
zend_call_info *next_callee;
4242
zend_func_info *clone;
43-
int recursive;
43+
zend_bool recursive;
44+
zend_bool send_unpack; /* Parameters passed by SEND_UNPACK or SEND_ARRAY */
4445
int num_args;
4546
zend_send_arg_info arg_info[1];
4647
};

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ typedef struct _func_info_t {
5454

5555
static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa *ssa)
5656
{
57-
if (call_info->num_args == 2 || call_info->num_args == 3) {
57+
if (!call_info->send_unpack
58+
&& (call_info->num_args == 2 || call_info->num_args == 3)) {
5859
zend_op_array *op_array = call_info->caller_op_array;
5960
uint32_t t1 = _ssa_op1_info(op_array, ssa, call_info->arg_info[0].opline,
6061
&ssa->ops[call_info->arg_info[0].opline - op_array->opcodes]);

0 commit comments

Comments
 (0)