com php-src: Add assertion to prevent type narrowing: ext/opcache/Optimizer/zend_inference.c
| From: | Nikita Popov | Date: | Fri, 05 Aug 2016 14:30:57 +0000 |
| Subject: | com php-src: Add assertion to prevent type narrowing: ext/opcache/Optimizer/zend_inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93621@lists.php.net to get a copy of this message | ||
Commit: 1a780e67270cad5060aa52b3982cb66d971b0a4d
Author: Nikita Popov <nikic@php.net> Fri, 5 Aug 2016 16:30:57 +0200
Parents: fc7c81ff5484f28221c89be0847ea521b707aa8c
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1a780e67270cad5060aa52b3982cb66d971b0a4d
Log:
Add assertion to prevent type narrowing
Currently type narrowing is always a bug, make sure we know about
it.
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 20f2ae3..6f5928e 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -2153,6 +2153,7 @@ static void check_type_narrowing(const zend_op_array *op_array, zend_ssa *ssa,
z
* type inference)
*/
if (old_type & ~new_type) {
+ ZEND_ASSERT(0); /* Currently this should never happen */
reset_dependent_vars(op_array, ssa, worklist, var);
}
}