summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-07-05 12:03:25 +0300
committerDmitry Stogov <dmitry@zend.com>2019-07-05 12:03:25 +0300
commit48ca5a1e176c5301fedd1bc4f661969d6f9a49eb (patch)
treed9a6303bc1a0a054c1acd0d9612256e0ea887c74 /Zend/zend_execute.c
parent24ecfcc8339d0158d5cd209b8737d8d764703ded (diff)
downloadphp-git-48ca5a1e176c5301fedd1bc4f661969d6f9a49eb.tar.gz
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 0f2288ca03..f4670ca626 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1318,9 +1318,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)
@@ -1434,18 +1434,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:
@@ -1461,25 +1453,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: