Skip to content

Commit 5a90392

Browse files
committed
Use EX_NUM_TO_VAR() in more places
Not sure why I missed these before.
1 parent 1949a26 commit 5a90392

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ static int lookup_cv(zend_string *name) /* {{{ */{
505505
while (i < op_array->last_var) {
506506
if (ZSTR_H(op_array->vars[i]) == hash_value
507507
&& zend_string_equals(op_array->vars[i], name)) {
508-
return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
508+
return EX_NUM_TO_VAR(i);
509509
}
510510
i++;
511511
}
@@ -517,7 +517,7 @@ static int lookup_cv(zend_string *name) /* {{{ */{
517517
}
518518

519519
op_array->vars[i] = zend_string_copy(name);
520-
return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
520+
return EX_NUM_TO_VAR(i);
521521
}
522522
/* }}} */
523523

Zend/zend_opcode.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static void emit_live_range_raw(
593593

594594
ZEND_ASSERT(start < end);
595595
range = &op_array->live_range[op_array->last_live_range - 1];
596-
range->var = (uint32_t) (intptr_t) ZEND_CALL_VAR_NUM(NULL, op_array->last_var + var_num);
596+
range->var = EX_NUM_TO_VAR(op_array->last_var + var_num);
597597
range->var |= kind;
598598
range->start = start;
599599
range->end = end;
@@ -698,8 +698,7 @@ static void emit_live_range(
698698
/* COPY_TMP has a split live-range: One from the definition until the use in
699699
* "null" branch, and another from the start of the "non-null" branch to the
700700
* FREE opcode. */
701-
uint32_t rt_var_num =
702-
(uint32_t) (intptr_t) ZEND_CALL_VAR_NUM(NULL, op_array->last_var + var_num);
701+
uint32_t rt_var_num = EX_NUM_TO_VAR(op_array->last_var + var_num);
703702
zend_op *block_start_op = use_opline;
704703

705704
if (needs_live_range && !needs_live_range(op_array, orig_def_opline)) {

ext/opcache/Optimizer/dce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static zend_bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
416416

417417
if (free_var >= 0) {
418418
opline->opcode = ZEND_FREE;
419-
opline->op1.var = (uintptr_t) ZEND_CALL_VAR_NUM(NULL, ssa->vars[free_var].var);
419+
opline->op1.var = EX_NUM_TO_VAR(ssa->vars[free_var].var);
420420
opline->op1_type = free_var_type;
421421

422422
ssa_op->op1_use = free_var;

0 commit comments

Comments
 (0)