]> granicus.if.org Git - php/commitdiff
Add assertion to prevent type narrowing
authorNikita Popov <nikic@php.net>
Fri, 5 Aug 2016 14:30:57 +0000 (16:30 +0200)
committerNikita Popov <nikic@php.net>
Fri, 5 Aug 2016 14:30:57 +0000 (16:30 +0200)
Currently type narrowing is always a bug, make sure we know about
it.

ext/opcache/Optimizer/zend_inference.c

index 20f2ae37dbec56463334b4efd7554b1a0611d750..6f5928e08c3a1acbe9636ad16b87bcd0e7ceea76 100644 (file)
@@ -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);
        }
 }