com php-src: Remove BP_VAR_REF: Zend/zend_compile.c Zend/zend_compile.h
| From: | Nikita Popov | Date: | Fri, 11 Dec 2015 14:56:52 +0000 |
| Subject: | com php-src: Remove BP_VAR_REF: Zend/zend_compile.c Zend/zend_compile.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90231@lists.php.net to get a copy of this message | ||
Commit: 591fe26d5d1c9df3bbd7f98a45aab2dae54bf043
Author: Nikita Popov <nikic@php.net> Fri, 11 Dec 2015 15:56:52 +0100
Parents: 1fdb63fbd91a1930822b1c1e6cdf15a55de5faf0
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=591fe26d5d1c9df3bbd7f98a45aab2dae54bf043
Log:
Remove BP_VAR_REF
The distinction between BP_VAR_REF and BP_VAR_W is no longer
revelant, since we dropped support for =& new.
Changed paths:
M Zend/zend_compile.c
M Zend/zend_compile.h
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 3295451..486a722 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -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");
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 188339c..c02cf53 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -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