com php-src: Remove some dead code in RECV type inference: ext/opcache/Optimizer/zend_inference.c
| From: | Nikita Popov | Date: | Thu, 30 Jul 2020 14:55:21 +0000 |
| Subject: | com php-src: Remove some dead code in RECV type inference: ext/opcache/Optimizer/zend_inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112461@lists.php.net to get a copy of this message | ||
Commit: ce22cf5198fd13ecd32d9786c808906bcddb7459
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 30 Jul 2020 16:53:11 +0200
Parents: 28eaad096933d050559bee41e5790dd595c6988e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ce22cf5198fd13ecd32d9786c808906bcddb7459
Log:
Remove some dead code in RECV type inference
We must always have arg_info corresponding to RECV.
Changed paths:
M ext/opcache/Optimizer/zend_inference.c
Diff:
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 &&