Skip to content

Commit e9a3d97

Browse files
committed
Zend/Optimizer: Use type uint32_t instead of int for _zend_call_info.num_args
1 parent 6bce88c commit e9a3d97

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Zend/Optimizer/sccp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,6 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
16501650
{
16511651
zend_call_info *call;
16521652
zval *name, *args[3] = {NULL};
1653-
int i;
16541653

16551654
if (!ctx->call_map) {
16561655
SET_RESULT_BOT(result);
@@ -1672,7 +1671,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
16721671
break;
16731672
}
16741673

1675-
for (i = 0; i < call->num_args; i++) {
1674+
for (uint32_t i = 0; i < call->num_args; i++) {
16761675
zend_op *opline = call->arg_info[i].opline;
16771676
if (opline->opcode != ZEND_SEND_VAL && opline->opcode != ZEND_SEND_VAR) {
16781677
SET_RESULT_BOT(result);
@@ -2088,7 +2087,6 @@ static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op)
20882087
zend_ssa *ssa = ctx->scdf.ssa;
20892088
zend_op_array *op_array = ctx->scdf.op_array;
20902089
zend_call_info *call;
2091-
int i;
20922090

20932091
ZEND_ASSERT(ctx->call_map);
20942092
call = ctx->call_map[opline - op_array->opcodes];
@@ -2098,7 +2096,7 @@ static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op)
20982096
zend_ssa_remove_instr(ssa, call->caller_init_opline,
20992097
&ssa->ops[call->caller_init_opline - op_array->opcodes]);
21002098

2101-
for (i = 0; i < call->num_args; i++) {
2099+
for (uint32_t i = 0; i < call->num_args; i++) {
21022100
zend_ssa_remove_instr(ssa, call->arg_info[i].opline,
21032101
&ssa->ops[call->arg_info[i].opline - op_array->opcodes]);
21042102
}

Zend/Optimizer/zend_call_graph.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,12 @@ ZEND_API zend_call_info **zend_build_call_map(zend_arena **arena, zend_func_info
272272

273273
map = zend_arena_calloc(arena, sizeof(zend_call_info *), op_array->last);
274274
for (call = info->callee_info; call; call = call->next_callee) {
275-
int i;
276275
map[call->caller_init_opline - op_array->opcodes] = call;
277276
if (call->caller_call_opline) {
278277
map[call->caller_call_opline - op_array->opcodes] = call;
279278
}
280279
if (!call->is_frameless) {
281-
for (i = 0; i < call->num_args; i++) {
280+
for (uint32_t i = 0; i < call->num_args; i++) {
282281
if (call->arg_info[i].opline) {
283282
map[call->arg_info[i].opline - op_array->opcodes] = call;
284283
}

Zend/Optimizer/zend_call_graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct _zend_call_info {
3939
bool named_args; /* Function has named arguments */
4040
bool is_prototype; /* An overridden child method may be called */
4141
bool is_frameless; /* A frameless function sends arguments through operands */
42-
int num_args; /* Number of arguments, excluding named and variadic arguments */
42+
uint32_t num_args; /* Number of arguments, excluding named and variadic arguments */
4343
zend_send_arg_info arg_info[1];
4444
};
4545

0 commit comments

Comments
 (0)