Skip to content

Commit 6a43d07

Browse files
committed
Zend/Optimizer/block_pass.c: prevent variable shadowing
1 parent 152efe1 commit 6a43d07

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Zend/Optimizer/block_pass.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,8 @@ static void assemble_code_blocks(const zend_cfg *cfg, zend_op_array *op_array, z
10421042
} else {
10431043
/* this block will not be used, delete all constants there */
10441044
const zend_op *op = op_array->opcodes + b->start;
1045-
const zend_op *end = op + b->len;
1046-
for (; op < end; op++) {
1045+
const zend_op *last_op = op + b->len;
1046+
for (; op < last_op; op++) {
10471047
if (op->op1_type == IS_CONST) {
10481048
literal_dtor(&ZEND_OP1_LITERAL(op));
10491049
}
@@ -1159,15 +1159,15 @@ static void assemble_code_blocks(const zend_cfg *cfg, zend_op_array *op_array, z
11591159
}
11601160

11611161
if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) {
1162-
zend_op *opline = new_opcodes;
1163-
const zend_op *end = opline + len;
1164-
while (opline < end) {
1165-
if (opline->opcode == ZEND_FAST_RET &&
1166-
opline->op2.num != (uint32_t)-1 &&
1167-
opline->op2.num < j) {
1168-
opline->op2.num = map[opline->op2.num];
1162+
zend_op *finally_opline = new_opcodes;
1163+
const zend_op *last_finally_op = finally_opline + len;
1164+
while (finally_opline < last_finally_op) {
1165+
if (finally_opline->opcode == ZEND_FAST_RET &&
1166+
finally_opline->op2.num != (uint32_t)-1 &&
1167+
finally_opline->op2.num < j) {
1168+
finally_opline->op2.num = map[finally_opline->op2.num];
11691169
}
1170-
opline++;
1170+
finally_opline++;
11711171
}
11721172
}
11731173
}

0 commit comments

Comments
 (0)