com php-src: Detect undefined variable usage: ext/opcache/Optim izer/zend_inference.c
| From: | Dmitry Stogov | Date: | Wed, 30 Aug 2017 13:02:29 +0000 |
| Subject: | com php-src: Detect undefined variable usage: ext/opcache/Optim izer/zend_inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99199@lists.php.net to get a copy of this message | ||
Commit: 44064529a81ddf0f40b244cac0cd98f89c935ae0
Author: Dmitry Stogov <dmitry@zend.com> Wed, 30 Aug 2017 16:02:29 +0300
Parents: a0c76de006852cc91ed12544b74c4f2013047395
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=44064529a81ddf0f40b244cac0cd98f89c935ae0
Log:
Detect undefined variable usage
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 903fb1d..a0a23e6 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -4174,6 +4174,11 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa
*ssa
case ZEND_UNSET_VAR:
return (t1 &
(MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY));
case ZEND_ASSIGN_DIM:
+ if ((opline+1)->op1_type == IS_CV) {
+ if (_ssa_op1_info(op_array, ssa, opline+1) & MAY_BE_UNDEF) {
+ return 1;
+ }
+ }
return (t1 &
(MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_TRUE|MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE)) ||
opline->op2_type == IS_UNUSED ||
(t2 & (MAY_BE_UNDEF|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
case ZEND_ASSIGN_OBJ: