@@ -2343,7 +2343,7 @@ static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_n
2343
2343
}
2344
2344
/* }}} */
2345
2345
2346
- void zend_ensure_writable_variable (const zend_ast * ast ) /* {{{ */
2346
+ static void zend_ensure_writable_variable (const zend_ast * ast ) /* {{{ */
2347
2347
{
2348
2348
if (ast -> kind == ZEND_AST_CALL ) {
2349
2349
zend_error_noreturn (E_COMPILE_ERROR , "Can't use function return value in write context" );
@@ -5648,6 +5648,8 @@ void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */
5648
5648
zend_ast * var_ast = ast -> child [0 ];
5649
5649
ZEND_ASSERT (ast -> kind == ZEND_AST_POST_INC || ast -> kind == ZEND_AST_POST_DEC );
5650
5650
5651
+ zend_ensure_writable_variable (var_ast );
5652
+
5651
5653
if (var_ast -> kind == ZEND_AST_PROP ) {
5652
5654
zend_op * opline = zend_compile_prop_common (NULL , var_ast , BP_VAR_RW );
5653
5655
opline -> opcode = ast -> kind == ZEND_AST_POST_INC ? ZEND_POST_INC_OBJ : ZEND_POST_DEC_OBJ ;
@@ -5666,6 +5668,8 @@ void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */
5666
5668
zend_ast * var_ast = ast -> child [0 ];
5667
5669
ZEND_ASSERT (ast -> kind == ZEND_AST_PRE_INC || ast -> kind == ZEND_AST_PRE_DEC );
5668
5670
5671
+ zend_ensure_writable_variable (var_ast );
5672
+
5669
5673
if (var_ast -> kind == ZEND_AST_PROP ) {
5670
5674
zend_op * opline = zend_compile_prop_common (result , var_ast , BP_VAR_RW );
5671
5675
opline -> opcode = ast -> kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_OBJ : ZEND_PRE_DEC_OBJ ;
0 commit comments