]> granicus.if.org Git - php/commitdiff
Remove BP_VAR_REF
authorNikita Popov <nikic@php.net>
Fri, 11 Dec 2015 14:56:52 +0000 (15:56 +0100)
committerNikita Popov <nikic@php.net>
Fri, 11 Dec 2015 14:56:52 +0000 (15:56 +0100)
The distinction between BP_VAR_REF and BP_VAR_W is no longer
revelant, since we dropped support for =& new.

Zend/zend_compile.c
Zend/zend_compile.h

index 329545138dfcd9ce6cab572038c9de64ea5f0926..486a722ec5ff3d9b47b0a1be49340223226af921 100644 (file)
@@ -1860,7 +1860,6 @@ static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
                case BP_VAR_R:
                        return;
                case BP_VAR_W:
-               case BP_VAR_REF:
                        opline->opcode += 1 * factor;
                        return;
                case BP_VAR_RW:
@@ -2830,7 +2829,7 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */
        zend_ensure_writable_variable(target_ast);
 
        zend_compile_var(&target_node, target_ast, BP_VAR_W);
-       zend_compile_var(&source_node, source_ast, BP_VAR_REF);
+       zend_compile_var(&source_node, source_ast, BP_VAR_W);
 
        if (source_node.op_type != IS_VAR && zend_is_call(source_ast)) {
                zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context");
@@ -3805,7 +3804,7 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
                expr_node.op_type = IS_CONST;
                ZVAL_NULL(&expr_node.u.constant);
        } else if (by_ref && zend_is_variable(expr_ast) && !zend_is_call(expr_ast)) {
-               zend_compile_var(&expr_node, expr_ast, BP_VAR_REF);
+               zend_compile_var(&expr_node, expr_ast, BP_VAR_W);
        } else {
                zend_compile_expr(&expr_node, expr_ast);
        }
@@ -6502,7 +6501,7 @@ void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
 
        if (value_ast) {
                if (returns_by_ref && zend_is_variable(value_ast) && !zend_is_call(value_ast)) {
-                       zend_compile_var(&value_node, value_ast, BP_VAR_REF);
+                       zend_compile_var(&value_node, value_ast, BP_VAR_W);
                } else {
                        zend_compile_expr(&value_node, value_ast);
                }
@@ -7467,9 +7466,7 @@ void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
                        *result = *zend_ast_get_znode(ast);
                        return;
                default:
-                       if (type == BP_VAR_W || type == BP_VAR_REF
-                               || type == BP_VAR_RW || type == BP_VAR_UNSET
-                       ) {
+                       if (type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) {
                                zend_error_noreturn(E_COMPILE_ERROR,
                                        "Cannot use temporary expression in write context");
                        }
index 188339c37b9904f7f2b0662c0fa8dadb8ba30928..c02cf5371df16730c32c98c25c9a8af305758497 100644 (file)
@@ -860,7 +860,6 @@ ZEND_API void zend_assert_valid_class_name(const zend_string *const_name);
 #define BP_VAR_IS                      3
 #define BP_VAR_FUNC_ARG                4
 #define BP_VAR_UNSET           5
-#define BP_VAR_REF          6   /* right-hand side of by-ref assignment */
 
 /* Bottom 3 bits are the type, top bits are arg num for BP_VAR_FUNC_ARG */
 #define BP_VAR_SHIFT 3