]> granicus.if.org Git - php/commitdiff
Fixed incorrect invariant guard motion
authorDmitry Stogov <dmitry@zend.com>
Wed, 11 Nov 2020 14:34:46 +0000 (17:34 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 11 Nov 2020 14:34:46 +0000 (17:34 +0300)
ext/opcache/jit/zend_jit_trace.c

index 85f09d3275da6a9c9908ee4e810c30ca25e45ec8..41e81b63f745bd0e22446dd6d4369fa6cbc2d698 100644 (file)
@@ -2197,7 +2197,8 @@ propagate_arg:
                                                ssa_var_info[phi->sources[0]].type = MAY_BE_GUARD | (t & t0);
                                        }
                                        if ((t1 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) != (t & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF))) {
-                                               if (is_checked_guard(tssa, ssa_opcodes, phi->sources[1], phi->ssa_var)) {
+                                               if (((t & t1) & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) != 0
+                                                && is_checked_guard(tssa, ssa_opcodes, phi->sources[1], phi->ssa_var)) {
                                                        ssa_var_info[phi->sources[1]].type = MAY_BE_GUARD | (t & t1);
                                                        ssa_var_info[phi->ssa_var].type = t & ~MAY_BE_GUARD;
                                                }