@@ -2610,6 +2610,7 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
2610
2610
opline -> extended_value = ZEND_FETCH_LOCAL ;
2611
2611
}
2612
2612
2613
+ zend_adjust_for_fetch_type (opline , type );
2613
2614
return opline ;
2614
2615
}
2615
2616
/* }}} */
@@ -2630,8 +2631,7 @@ static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type,
2630
2631
if (is_this_fetch (ast )) {
2631
2632
zend_emit_op (result , ZEND_FETCH_THIS , NULL , NULL );
2632
2633
} else if (zend_try_compile_cv (result , ast ) == FAILURE ) {
2633
- zend_op * opline = zend_compile_simple_var_no_cv (result , ast , type , delayed );
2634
- zend_adjust_for_fetch_type (opline , type );
2634
+ zend_compile_simple_var_no_cv (result , ast , type , delayed );
2635
2635
}
2636
2636
}
2637
2637
/* }}} */
@@ -2672,6 +2672,7 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t
2672
2672
{
2673
2673
zend_ast * var_ast = ast -> child [0 ];
2674
2674
zend_ast * dim_ast = ast -> child [1 ];
2675
+ zend_op * opline ;
2675
2676
2676
2677
znode var_node , dim_node ;
2677
2678
@@ -2691,25 +2692,20 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t
2691
2692
zend_handle_numeric_op (& dim_node );
2692
2693
}
2693
2694
2694
- return zend_delayed_emit_op (result , ZEND_FETCH_DIM_R , & var_node , & dim_node );
2695
+ opline = zend_delayed_emit_op (result , ZEND_FETCH_DIM_R , & var_node , & dim_node );
2696
+ zend_adjust_for_fetch_type (opline , type );
2697
+ return opline ;
2695
2698
}
2696
2699
/* }}} */
2697
2700
2698
- static inline zend_op * zend_compile_dim_common (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2701
+ static zend_op * zend_compile_dim (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2699
2702
{
2700
2703
uint32_t offset = zend_delayed_compile_begin ();
2701
2704
zend_delayed_compile_dim (result , ast , type );
2702
2705
return zend_delayed_compile_end (offset );
2703
2706
}
2704
2707
/* }}} */
2705
2708
2706
- void zend_compile_dim (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2707
- {
2708
- zend_op * opline = zend_compile_dim_common (result , ast , type );
2709
- zend_adjust_for_fetch_type (opline , type );
2710
- }
2711
- /* }}} */
2712
-
2713
2709
static zend_op * zend_delayed_compile_prop (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2714
2710
{
2715
2711
zend_ast * obj_ast = ast -> child [0 ];
@@ -2732,26 +2728,20 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
2732
2728
zend_alloc_polymorphic_cache_slot (opline -> op2 .constant );
2733
2729
}
2734
2730
2731
+ zend_adjust_for_fetch_type (opline , type );
2735
2732
return opline ;
2736
2733
}
2737
2734
/* }}} */
2738
2735
2739
- static zend_op * zend_compile_prop_common (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2736
+ static zend_op * zend_compile_prop (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2740
2737
{
2741
2738
uint32_t offset = zend_delayed_compile_begin ();
2742
2739
zend_delayed_compile_prop (result , ast , type );
2743
2740
return zend_delayed_compile_end (offset );
2744
2741
}
2745
2742
/* }}} */
2746
2743
2747
- void zend_compile_prop (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
2748
- {
2749
- zend_op * opline = zend_compile_prop_common (result , ast , type );
2750
- zend_adjust_for_fetch_type (opline , type );
2751
- }
2752
- /* }}} */
2753
-
2754
- zend_op * zend_compile_static_prop_common (znode * result , zend_ast * ast , uint32_t type , int delayed ) /* {{{ */
2744
+ zend_op * zend_compile_static_prop (znode * result , zend_ast * ast , uint32_t type , int delayed ) /* {{{ */
2755
2745
{
2756
2746
zend_ast * class_ast = ast -> child [0 ];
2757
2747
zend_ast * prop_ast = ast -> child [1 ];
@@ -2780,14 +2770,8 @@ zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t
2780
2770
SET_NODE (opline -> op2 , & class_node );
2781
2771
}
2782
2772
2783
- return opline ;
2784
- }
2785
- /* }}} */
2786
-
2787
- void zend_compile_static_prop (znode * result , zend_ast * ast , uint32_t type , int delayed ) /* {{{ */
2788
- {
2789
- zend_op * opline = zend_compile_static_prop_common (result , ast , type , delayed );
2790
2773
zend_adjust_for_fetch_type (opline , type );
2774
+ return opline ;
2791
2775
}
2792
2776
/* }}} */
2793
2777
@@ -4306,15 +4290,15 @@ void zend_compile_unset(zend_ast *ast) /* {{{ */
4306
4290
}
4307
4291
return ;
4308
4292
case ZEND_AST_DIM :
4309
- opline = zend_compile_dim_common (NULL , var_ast , BP_VAR_UNSET );
4293
+ opline = zend_compile_dim (NULL , var_ast , BP_VAR_UNSET );
4310
4294
opline -> opcode = ZEND_UNSET_DIM ;
4311
4295
return ;
4312
4296
case ZEND_AST_PROP :
4313
- opline = zend_compile_prop_common (NULL , var_ast , BP_VAR_UNSET );
4297
+ opline = zend_compile_prop (NULL , var_ast , BP_VAR_UNSET );
4314
4298
opline -> opcode = ZEND_UNSET_OBJ ;
4315
4299
return ;
4316
4300
case ZEND_AST_STATIC_PROP :
4317
- opline = zend_compile_static_prop_common (NULL , var_ast , BP_VAR_UNSET , 0 );
4301
+ opline = zend_compile_static_prop (NULL , var_ast , BP_VAR_UNSET , 0 );
4318
4302
opline -> opcode = ZEND_UNSET_STATIC_PROP ;
4319
4303
return ;
4320
4304
EMPTY_SWITCH_DEFAULT_CASE ()
@@ -7194,7 +7178,7 @@ void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */
7194
7178
zend_ensure_writable_variable (var_ast );
7195
7179
7196
7180
if (var_ast -> kind == ZEND_AST_PROP ) {
7197
- zend_op * opline = zend_compile_prop_common (NULL , var_ast , BP_VAR_RW );
7181
+ zend_op * opline = zend_compile_prop (NULL , var_ast , BP_VAR_RW );
7198
7182
opline -> opcode = ast -> kind == ZEND_AST_POST_INC ? ZEND_POST_INC_OBJ : ZEND_POST_DEC_OBJ ;
7199
7183
zend_make_tmp_result (result , opline );
7200
7184
} else {
@@ -7214,7 +7198,7 @@ void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */
7214
7198
zend_ensure_writable_variable (var_ast );
7215
7199
7216
7200
if (var_ast -> kind == ZEND_AST_PROP ) {
7217
- zend_op * opline = zend_compile_prop_common (result , var_ast , BP_VAR_RW );
7201
+ zend_op * opline = zend_compile_prop (result , var_ast , BP_VAR_RW );
7218
7202
opline -> opcode = ast -> kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_OBJ : ZEND_PRE_DEC_OBJ ;
7219
7203
} else {
7220
7204
znode var_node ;
@@ -7490,15 +7474,15 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */
7490
7474
}
7491
7475
break ;
7492
7476
case ZEND_AST_DIM :
7493
- opline = zend_compile_dim_common (result , var_ast , BP_VAR_IS );
7477
+ opline = zend_compile_dim (result , var_ast , BP_VAR_IS );
7494
7478
opline -> opcode = ZEND_ISSET_ISEMPTY_DIM_OBJ ;
7495
7479
break ;
7496
7480
case ZEND_AST_PROP :
7497
- opline = zend_compile_prop_common (result , var_ast , BP_VAR_IS );
7481
+ opline = zend_compile_prop (result , var_ast , BP_VAR_IS );
7498
7482
opline -> opcode = ZEND_ISSET_ISEMPTY_PROP_OBJ ;
7499
7483
break ;
7500
7484
case ZEND_AST_STATIC_PROP :
7501
- opline = zend_compile_static_prop_common (result , var_ast , BP_VAR_IS , 0 );
7485
+ opline = zend_compile_static_prop (result , var_ast , BP_VAR_IS , 0 );
7502
7486
opline -> opcode = ZEND_ISSET_ISEMPTY_STATIC_PROP ;
7503
7487
break ;
7504
7488
EMPTY_SWITCH_DEFAULT_CASE ()
@@ -8363,18 +8347,15 @@ void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
8363
8347
8364
8348
void zend_delayed_compile_var (znode * result , zend_ast * ast , uint32_t type ) /* {{{ */
8365
8349
{
8366
- zend_op * opline ;
8367
8350
switch (ast -> kind ) {
8368
8351
case ZEND_AST_VAR :
8369
8352
zend_compile_simple_var (result , ast , type , 1 );
8370
8353
return ;
8371
8354
case ZEND_AST_DIM :
8372
- opline = zend_delayed_compile_dim (result , ast , type );
8373
- zend_adjust_for_fetch_type (opline , type );
8355
+ zend_delayed_compile_dim (result , ast , type );
8374
8356
return ;
8375
8357
case ZEND_AST_PROP :
8376
- opline = zend_delayed_compile_prop (result , ast , type );
8377
- zend_adjust_for_fetch_type (opline , type );
8358
+ zend_delayed_compile_prop (result , ast , type );
8378
8359
return ;
8379
8360
case ZEND_AST_STATIC_PROP :
8380
8361
zend_compile_static_prop (result , ast , type , 1 );
0 commit comments