@@ -122,7 +122,7 @@ static void empty_partial_array(zval *zv)
122122 Z_ARR_P (zv ) = zend_new_array (8 );
123123}
124124
125- static void dup_partial_array (zval * dst , zval * src )
125+ static void dup_partial_array (zval * dst , const zval * src )
126126{
127127 MAKE_PARTIAL_ARRAY (dst );
128128 Z_ARR_P (dst ) = zend_array_dup (Z_ARR_P (src ));
@@ -134,7 +134,7 @@ static void empty_partial_object(zval *zv)
134134 Z_ARR_P (zv ) = zend_new_array (8 );
135135}
136136
137- static void dup_partial_object (zval * dst , zval * src )
137+ static void dup_partial_object (zval * dst , const zval * src )
138138{
139139 MAKE_PARTIAL_OBJECT (dst );
140140 Z_ARR_P (dst ) = zend_array_dup (Z_ARR_P (src ));
@@ -146,7 +146,7 @@ static inline bool value_known(zval *zv) {
146146
147147/* Sets new value for variable and ensures that it is lower or equal
148148 * the previous one in the constant propagation lattice. */
149- static void set_value (scdf_ctx * scdf , sccp_ctx * ctx , int var , zval * new ) {
149+ static void set_value (scdf_ctx * scdf , sccp_ctx * ctx , int var , const zval * new ) {
150150 zval * value = & ctx -> values [var ];
151151 if (IS_BOT (value ) || IS_TOP (new )) {
152152 return ;
@@ -186,7 +186,7 @@ static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, zval *new) {
186186#endif
187187}
188188
189- static zval * get_op1_value (sccp_ctx * ctx , zend_op * opline , zend_ssa_op * ssa_op ) {
189+ static zval * get_op1_value (sccp_ctx * ctx , zend_op * opline , const zend_ssa_op * ssa_op ) {
190190 if (opline -> op1_type == IS_CONST ) {
191191 return CT_CONSTANT_EX (ctx -> scdf .op_array , opline -> op1 .constant );
192192 } else if (ssa_op -> op1_use != -1 ) {
@@ -196,7 +196,7 @@ static zval *get_op1_value(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op)
196196 }
197197}
198198
199- static zval * get_op2_value (sccp_ctx * ctx , zend_op * opline , zend_ssa_op * ssa_op ) {
199+ static zval * get_op2_value (sccp_ctx * ctx , const zend_op * opline , const zend_ssa_op * ssa_op ) {
200200 if (opline -> op2_type == IS_CONST ) {
201201 return CT_CONSTANT_EX (ctx -> scdf .op_array , opline -> op2 .constant );
202202 } else if (ssa_op -> op2_use != -1 ) {
@@ -207,7 +207,7 @@ static zval *get_op2_value(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op)
207207}
208208
209209static bool can_replace_op1 (
210- const zend_op_array * op_array , zend_op * opline , zend_ssa_op * ssa_op ) {
210+ const zend_op_array * op_array , const zend_op * opline , const zend_ssa_op * ssa_op ) {
211211 switch (opline -> opcode ) {
212212 case ZEND_PRE_INC :
213213 case ZEND_PRE_DEC :
@@ -441,7 +441,7 @@ static inline zend_result ct_eval_isset_dim(zval *result, uint32_t extended_valu
441441 }
442442}
443443
444- static inline zend_result ct_eval_del_array_elem (zval * result , zval * key ) {
444+ static inline zend_result ct_eval_del_array_elem (zval * result , const zval * key ) {
445445 ZEND_ASSERT (IS_PARTIAL_ARRAY (result ));
446446
447447 switch (Z_TYPE_P (key )) {
@@ -475,7 +475,7 @@ static inline zend_result ct_eval_del_array_elem(zval *result, zval *key) {
475475 return SUCCESS ;
476476}
477477
478- static inline zend_result ct_eval_add_array_elem (zval * result , zval * value , zval * key ) {
478+ static inline zend_result ct_eval_add_array_elem (zval * result , zval * value , const zval * key ) {
479479 if (!key ) {
480480 SEPARATE_ARRAY (result );
481481 if ((value = zend_hash_next_index_insert (Z_ARR_P (result ), value ))) {
@@ -546,7 +546,7 @@ static inline zend_result ct_eval_add_array_unpack(zval *result, zval *array) {
546546 return SUCCESS ;
547547}
548548
549- static inline zend_result ct_eval_assign_dim (zval * result , zval * value , zval * key ) {
549+ static inline zend_result ct_eval_assign_dim (zval * result , zval * value , const zval * key ) {
550550 switch (Z_TYPE_P (result )) {
551551 case IS_NULL :
552552 case IS_FALSE :
@@ -622,7 +622,7 @@ static inline zend_result ct_eval_isset_obj(zval *result, uint32_t extended_valu
622622 }
623623}
624624
625- static inline zend_result ct_eval_del_obj_prop (zval * result , zval * key ) {
625+ static inline zend_result ct_eval_del_obj_prop (zval * result , const zval * key ) {
626626 ZEND_ASSERT (IS_PARTIAL_OBJECT (result ));
627627
628628 switch (Z_TYPE_P (key )) {
@@ -636,7 +636,7 @@ static inline zend_result ct_eval_del_obj_prop(zval *result, zval *key) {
636636 return SUCCESS ;
637637}
638638
639- static inline zend_result ct_eval_add_obj_prop (zval * result , zval * value , zval * key ) {
639+ static inline zend_result ct_eval_add_obj_prop (zval * result , zval * value , const zval * key ) {
640640 switch (Z_TYPE_P (key )) {
641641 case IS_STRING :
642642 value = zend_symtable_update (Z_ARR_P (result ), Z_STR_P (key ), value );
@@ -649,7 +649,7 @@ static inline zend_result ct_eval_add_obj_prop(zval *result, zval *value, zval *
649649 return SUCCESS ;
650650}
651651
652- static inline zend_result ct_eval_assign_obj (zval * result , zval * value , zval * key ) {
652+ static inline zend_result ct_eval_assign_obj (zval * result , zval * value , const zval * key ) {
653653 switch (Z_TYPE_P (result )) {
654654 case IS_NULL :
655655 case IS_FALSE :
0 commit comments