summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-07-05 12:16:30 +0300
committerDmitry Stogov <dmitry@zend.com>2019-07-05 12:16:30 +0300
commit1b5b8175aff0fba41ce94d75d1ddf0f7be630b9c (patch)
tree7fef7cefe333517cf9640eee34b198e865a4f9e5 /Zend/zend_execute.c
parent215e9d069c3dae40d94894d1a938d771cecc2549 (diff)
parent48ca5a1e176c5301fedd1bc4f661969d6f9a49eb (diff)
downloadphp-git-1b5b8175aff0fba41ce94d75d1ddf0f7be630b9c.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Replace ZEND_ASSIGN_ADD (and others) by ZEND_ASSIGN_OP, ZEND_ASSIGN_DIM_OP, ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c48
1 files changed, 15 insertions, 33 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 19293cc44c..bbe83240e6 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1342,9 +1342,9 @@ static zend_always_inline int zend_binary_op(zval *ret, zval *op1, zval *op2 OPL
pow_function
};
/* size_t cast makes GCC to better optimize 64-bit PIC code */
- size_t opcode = (size_t)opline->opcode;
+ size_t opcode = (size_t)opline->extended_value;
- return zend_binary_ops[opcode - ZEND_ASSIGN_ADD](ret, op1, op2);
+ return zend_binary_ops[opcode - ZEND_ADD](ret, op1, op2);
}
static zend_never_inline void zend_binary_assign_op_obj_dim(zval *object, zval *property, zval *value OPLINE_DC EXECUTE_DATA_DC)
@@ -1449,18 +1449,10 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
}
switch (opline->opcode) {
- case ZEND_ASSIGN_ADD:
- case ZEND_ASSIGN_SUB:
- case ZEND_ASSIGN_MUL:
- case ZEND_ASSIGN_DIV:
- case ZEND_ASSIGN_MOD:
- case ZEND_ASSIGN_SL:
- case ZEND_ASSIGN_SR:
- case ZEND_ASSIGN_CONCAT:
- case ZEND_ASSIGN_BW_OR:
- case ZEND_ASSIGN_BW_AND:
- case ZEND_ASSIGN_BW_XOR:
- case ZEND_ASSIGN_POW:
+ case ZEND_ASSIGN_OP:
+ case ZEND_ASSIGN_DIM_OP:
+ case ZEND_ASSIGN_OBJ_OP:
+ case ZEND_ASSIGN_STATIC_PROP_OP:
msg = "Cannot use assign-op operators with string offsets";
break;
case ZEND_FETCH_DIM_W:
@@ -1476,25 +1468,15 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
while (opline < end) {
if (opline->op1_type == IS_VAR && opline->op1.var == var) {
switch (opline->opcode) {
- case ZEND_ASSIGN_ADD:
- case ZEND_ASSIGN_SUB:
- case ZEND_ASSIGN_MUL:
- case ZEND_ASSIGN_DIV:
- case ZEND_ASSIGN_MOD:
- case ZEND_ASSIGN_SL:
- case ZEND_ASSIGN_SR:
- case ZEND_ASSIGN_CONCAT:
- case ZEND_ASSIGN_BW_OR:
- case ZEND_ASSIGN_BW_AND:
- case ZEND_ASSIGN_BW_XOR:
- case ZEND_ASSIGN_POW:
- if (opline->extended_value == ZEND_ASSIGN_OBJ) {
- msg = "Cannot use string offset as an object";
- } else if (opline->extended_value == ZEND_ASSIGN_DIM) {
- msg = "Cannot use string offset as an array";
- } else {
- msg = "Cannot use assign-op operators with string offsets";
- }
+ case ZEND_ASSIGN_OBJ_OP:
+ msg = "Cannot use string offset as an object";
+ break;
+ case ZEND_ASSIGN_DIM_OP:
+ msg = "Cannot use string offset as an array";
+ break;
+ case ZEND_ASSIGN_STATIC_PROP_OP:
+ case ZEND_ASSIGN_OP:
+ msg = "Cannot use assign-op operators with string offsets";
break;
case ZEND_PRE_INC_OBJ:
case ZEND_PRE_DEC_OBJ: