@@ -1903,12 +1903,14 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
1903
1903
}
1904
1904
/* }}} */
1905
1905
1906
- static void zend_adjust_for_fetch_type (zend_op * opline , uint32_t type ) /* {{{ */
1906
+ static void zend_adjust_for_fetch_type (zend_op * opline , znode * result , uint32_t type ) /* {{{ */
1907
1907
{
1908
1908
zend_uchar factor = (opline -> opcode == ZEND_FETCH_STATIC_PROP_R ) ? 1 : 3 ;
1909
1909
1910
1910
switch (type ) {
1911
1911
case BP_VAR_R :
1912
+ opline -> result_type = IS_TMP_VAR ;
1913
+ result -> op_type = IS_TMP_VAR ;
1912
1914
return ;
1913
1915
case BP_VAR_W :
1914
1916
opline -> opcode += 1 * factor ;
@@ -1917,6 +1919,8 @@ static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
1917
1919
opline -> opcode += 2 * factor ;
1918
1920
return ;
1919
1921
case BP_VAR_IS :
1922
+ opline -> result_type = IS_TMP_VAR ;
1923
+ result -> op_type = IS_TMP_VAR ;
1920
1924
opline -> opcode += 3 * factor ;
1921
1925
return ;
1922
1926
case BP_VAR_FUNC_ARG :
@@ -2598,7 +2602,7 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
2598
2602
opline -> extended_value = ZEND_FETCH_LOCAL ;
2599
2603
}
2600
2604
2601
- zend_adjust_for_fetch_type (opline , type );
2605
+ zend_adjust_for_fetch_type (opline , result , type );
2602
2606
return opline ;
2603
2607
}
2604
2608
/* }}} */
@@ -2617,7 +2621,11 @@ static zend_bool is_this_fetch(zend_ast *ast) /* {{{ */
2617
2621
static void zend_compile_simple_var (znode * result , zend_ast * ast , uint32_t type , int delayed ) /* {{{ */
2618
2622
{
2619
2623
if (is_this_fetch (ast )) {
2620
- zend_emit_op (result , ZEND_FETCH_THIS , NULL , NULL );
2624
+ zend_op * opline = zend_emit_op (result , ZEND_FETCH_THIS , NULL , NULL );
2625
+ if ((type == BP_VAR_R ) || (type == BP_VAR_IS )) {
2626
+ opline -> result_type = IS_TMP_VAR ;
2627
+ result -> op_type = IS_TMP_VAR ;
2628
+ }
2621
2629
} else if (zend_try_compile_cv (result , ast ) == FAILURE ) {
2622
2630
zend_compile_simple_var_no_cv (result , ast , type , delayed );
2623
2631
}
@@ -2676,7 +2684,7 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t
2676
2684
}
2677
2685
2678
2686
opline = zend_delayed_emit_op (result , ZEND_FETCH_DIM_R , & var_node , & dim_node );
2679
- zend_adjust_for_fetch_type (opline , type );
2687
+ zend_adjust_for_fetch_type (opline , result , type );
2680
2688
return opline ;
2681
2689
}
2682
2690
/* }}} */
@@ -2711,7 +2719,7 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
2711
2719
opline -> extended_value = zend_alloc_polymorphic_cache_slot ();
2712
2720
}
2713
2721
2714
- zend_adjust_for_fetch_type (opline , type );
2722
+ zend_adjust_for_fetch_type (opline , result , type );
2715
2723
return opline ;
2716
2724
}
2717
2725
/* }}} */
@@ -2756,7 +2764,7 @@ zend_op *zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, i
2756
2764
SET_NODE (opline -> op2 , & class_node );
2757
2765
}
2758
2766
2759
- zend_adjust_for_fetch_type (opline , type );
2767
+ zend_adjust_for_fetch_type (opline , result , type );
2760
2768
return opline ;
2761
2769
}
2762
2770
/* }}} */
@@ -3216,7 +3224,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc) /* {{{ */
3216
3224
opcode = ZEND_SEND_REF ;
3217
3225
} else {
3218
3226
zend_compile_var (& arg_node , arg , BP_VAR_R );
3219
- opcode = ZEND_SEND_VAR ;
3227
+ opcode = ( arg_node . op_type == IS_TMP_VAR ) ? ZEND_SEND_VAL : ZEND_SEND_VAR ;
3220
3228
}
3221
3229
} else {
3222
3230
do {
0 commit comments