diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-07-30 16:53:11 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-07-30 16:55:21 +0200 |
| commit | ce22cf5198fd13ecd32d9786c808906bcddb7459 (patch) | |
| tree | 90ae987111313dee11fad055b96ae5bea5c0734f | |
| parent | 28eaad096933d050559bee41e5790dd595c6988e (diff) | |
| download | php-git-ce22cf5198fd13ecd32d9786c808906bcddb7459.tar.gz | |
Remove some dead code in RECV type inference
We must always have arg_info corresponding to RECV.
| -rw-r--r-- | ext/opcache/Optimizer/zend_inference.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index b5208c1fc5..f5059104de 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -3006,36 +3006,20 @@ static zend_always_inline int _zend_update_type_info( { /* Typehinting */ zend_func_info *func_info; - zend_arg_info *arg_info = NULL; - if (op_array->arg_info && opline->op1.num <= op_array->num_args) { - arg_info = &op_array->arg_info[opline->op1.num-1]; - } + zend_arg_info *arg_info = &op_array->arg_info[opline->op1.num-1]; ce = NULL; - if (arg_info) { - tmp = zend_fetch_arg_info_type(script, arg_info, &ce); - if (ZEND_ARG_SEND_MODE(arg_info)) { - tmp |= MAY_BE_REF; - } - } else { - tmp = MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN|MAY_BE_ANY|MAY_BE_ARRAY_KEY_ANY|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF; + tmp = zend_fetch_arg_info_type(script, arg_info, &ce); + if (ZEND_ARG_SEND_MODE(arg_info)) { + tmp |= MAY_BE_REF; } + func_info = ZEND_FUNC_INFO(op_array); if (func_info && (int)opline->op1.num-1 < func_info->num_args) { tmp = (tmp & (MAY_BE_RC1|MAY_BE_RCN|MAY_BE_REF)) | (tmp & func_info->arg_info[opline->op1.num-1].info.type); } -#if 0 - /* We won't receive unused arguments */ - if (ssa_vars[ssa_op->result_def].use_chain < 0 && - ssa_vars[ssa_op->result_def].phi_use_chain == NULL && - op_array->arg_info && - opline->op1.num <= op_array->num_args && - op_array->arg_info[opline->op1.num-1].class_name == NULL && - !op_array->arg_info[opline->op1.num-1].type_hint) { - tmp = MAY_BE_UNDEF|MAY_BE_RCN; - } -#endif + UPDATE_SSA_TYPE(tmp, ssa_op->result_def); if (func_info && (int)opline->op1.num-1 < func_info->num_args && |
