mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Added few more instructions without side effects and exceptions
This commit is contained in:
parent
b17178f991
commit
3f42ce18ba
2 changed files with 13 additions and 0 deletions
|
@ -108,6 +108,15 @@ static inline zend_bool may_have_side_effects(
|
|||
case ZEND_ROPE_END:
|
||||
case ZEND_INIT_ARRAY:
|
||||
case ZEND_ADD_ARRAY_ELEMENT:
|
||||
case ZEND_SPACESHIP:
|
||||
case ZEND_STRLEN:
|
||||
case ZEND_COUNT:
|
||||
case ZEND_GET_TYPE:
|
||||
case ZEND_ISSET_ISEMPTY_THIS:
|
||||
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
|
||||
case ZEND_FETCH_DIM_IS:
|
||||
case ZEND_ISSET_ISEMPTY_VAR:
|
||||
case ZEND_FETCH_IS:
|
||||
/* No side effects */
|
||||
return 0;
|
||||
case ZEND_JMP:
|
||||
|
|
|
@ -4172,6 +4172,8 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa
|
|||
return (opline->op2_type != IS_UNUSED) && (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
|
||||
case ZEND_STRLEN:
|
||||
return (t1 & MAY_BE_ANY) != MAY_BE_STRING;
|
||||
case ZEND_COUNT:
|
||||
return (t1 & MAY_BE_ANY) != MAY_BE_ARRAY;
|
||||
case ZEND_RECV_INIT:
|
||||
if (Z_CONSTANT_P(CRT_CONSTANT_EX(op_array, opline->op2, ssa->rt_constants))) {
|
||||
return 1;
|
||||
|
@ -4191,6 +4193,8 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa
|
|||
} else {
|
||||
return 0;
|
||||
}
|
||||
case ZEND_FETCH_IS:
|
||||
return (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT));
|
||||
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
|
||||
case ZEND_FETCH_DIM_IS:
|
||||
return (t1 & MAY_BE_OBJECT) || (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue