]> granicus.if.org Git - php/commitdiff
Emit warning about type narrowing for tracing JIT as well
authorDmitry Stogov <dmitry@zend.com>
Fri, 13 Mar 2020 22:29:46 +0000 (01:29 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 13 Mar 2020 22:29:46 +0000 (01:29 +0300)
ext/opcache/Optimizer/zend_inference.c

index 495aedfda2a5dda32746fcf9fdcf749f32df2abe..0dc6ab477d17feeb36c84b76ee67c0f8618467c7 100644 (file)
@@ -1848,18 +1848,13 @@ static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) {
                                }                                                                                                               \
                        }                                                                                                                       \
                        if (ssa_var_info[__var].type != __type) {                                       \
+                               if (ssa_var_info[__var].type & ~__type) {                               \
+                                       emit_type_narrowing_warning(op_array, ssa, __var);      \
+                                       return FAILURE;                                                                         \
+                               }                                                                                                               \
+                               ssa_var_info[__var].type = __type;                                              \
                                if (update_worklist) {                                                                  \
-                                       if (ssa_var_info[__var].type & ~__type) {                       \
-                                               emit_type_narrowing_warning(op_array, ssa, __var);\
-                                               return FAILURE;                                                                 \
-                                       }                                                                                                       \
-                                       ssa_var_info[__var].type = __type;                                      \
                                        add_usages(op_array, ssa, worklist, __var);                     \
-                               } else {                                                                                                \
-                                       if (ssa_var_info[__var].type & ~__type) {                       \
-                                               return FAILURE;                                                                 \
-                                       }                                                                                                       \
-                                       ssa_var_info[__var].type = __type;                                      \
                                }                                                                                                               \
                        }                                                                                                                       \
                        /*zend_bitset_excl(worklist, var);*/                                            \