@@ -2019,7 +2019,10 @@ static void handle_type_narrowing(const zend_op_array *op_array, zend_ssa *ssa,
2019
2019
{
2020
2020
if (1 ) {
2021
2021
/* Right now, this is always a bug */
2022
- zend_error (E_WARNING , "Narrowing occurred during type inference. Please file a bug report on bugs.php.net" );
2022
+ int def_op_num = ssa -> vars [var ].definition ;
2023
+ const zend_op * def_opline = def_op_num >= 0 ? & op_array -> opcodes [def_op_num ] : NULL ;
2024
+ const char * def_op_name = def_opline ? zend_get_opcode_name (def_opline -> opcode ) : "PHI" ;
2025
+ zend_error (E_WARNING , "Narrowing occurred during type inference of %s. Please file a bug report on bugs.php.net" , def_op_name );
2023
2026
} else {
2024
2027
/* if new_type set resets some bits from old_type set
2025
2028
* We have completely recalculate types of some dependent SSA variables
@@ -2555,7 +2558,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
2555
2558
tmp |= MAY_BE_RCN ;
2556
2559
}
2557
2560
}
2558
- if ((t1 & MAY_BE_ANY ) == MAY_BE_LONG ) {
2561
+ if ((t1 & ( MAY_BE_ANY | MAY_BE_UNDEF ) ) == MAY_BE_LONG ) {
2559
2562
if (!ssa_var_info [ssa_ops [i ].op1_use ].has_range ||
2560
2563
(opline -> opcode == ZEND_PRE_DEC &&
2561
2564
(ssa_var_info [ssa_ops [i ].op1_use ].range .underflow ||
@@ -2617,7 +2620,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
2617
2620
if (t1 & (MAY_BE_RC1 |MAY_BE_RCN )) {
2618
2621
tmp |= MAY_BE_RC1 ;
2619
2622
}
2620
- if ((t1 & MAY_BE_ANY ) == MAY_BE_LONG ) {
2623
+ if ((t1 & ( MAY_BE_ANY | MAY_BE_UNDEF ) ) == MAY_BE_LONG ) {
2621
2624
if (!ssa_var_info [ssa_ops [i ].op1_use ].has_range ||
2622
2625
(opline -> opcode == ZEND_PRE_DEC &&
2623
2626
(ssa_var_info [ssa_ops [i ].op1_use ].range .underflow ||
0 commit comments