com php-src: Make opcache infer array_key_exists is non -null bool: ext/opcache/Optimizer/zend_inference.c

From: Date: Tue, 19 Nov 2019 21:11:51 +0000
Subject: com php-src: Make opcache infer array_key_exists is non -null bool: ext/opcache/Optimizer/zend_inference.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-109293@lists.php.net to get a copy of this message
Commit: f7c44ef2a0e1e1e5bed5527b8899c66b00416f43 Author: Tyson Andre <tysonandre775@hotmail.com> Tue, 19 Nov 2019 08:58:48 -0500 Committer: Dmitry Stogov <dmitry@zend.com> Wed, 20 Nov 2019 00:11:51 +0300 Parents: e2a8cc0114849ec7eff4ef74eb21778523c184f1 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f7c44ef2a0e1e1e5bed5527b8899c66b00416f43 Log: Make opcache infer array_key_exists is non-null bool array_key_exists now throws a TypeError instead of returning null for invalid arguments after 14bdb0cfc7b62205c75f6d5c783e343259796776 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 cb31ea21f2c..975853a9eb5 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2480,14 +2480,8 @@ static int zend_update_type_info(const zend_op_array *op_array, case ZEND_ISSET_ISEMPTY_STATIC_PROP: case ZEND_ASSERT_CHECK: case ZEND_IN_ARRAY: - UPDATE_SSA_TYPE(MAY_BE_FALSE|MAY_BE_TRUE, ssa_ops[i].result_def); - break; case ZEND_ARRAY_KEY_EXISTS: - tmp = MAY_BE_FALSE|MAY_BE_TRUE; - if (t2 & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_ARRAY|MAY_BE_OBJECT))) { - tmp |= MAY_BE_NULL; - } - UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def); + UPDATE_SSA_TYPE(MAY_BE_FALSE|MAY_BE_TRUE, ssa_ops[i].result_def); break; case ZEND_CAST: if (ssa_ops[i].op1_def >= 0) {

« previous php.cvs (#109293) next »