]> granicus.if.org Git - php/commitdiff
Fixed use-after-free in PHPUnit tests
authorDmitry Stogov <dmitry@zend.com>
Mon, 23 Nov 2020 11:42:38 +0000 (14:42 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 23 Nov 2020 11:42:38 +0000 (14:42 +0300)
ext/opcache/jit/zend_jit_trace.c

index e50a418f444895ca03fb055ad0441adb90eeab63..8e01c731622cdfd7dc7184cd6cc8f546efef1b2d 100644 (file)
@@ -3245,6 +3245,9 @@ static int zend_jit_trace_deoptimization(dasm_State             **Dst,
                                } else if (reg == ZREG_THIS) {
                                        if (polymorphic_side_trace) {
                                                ssa->var_info[i].delayed_fetch_this = 1;
+                                               if (stack) {
+                                                       SET_STACK_REG(stack, i, ZREG_THIS);
+                                               }
                                        } else if (!zend_jit_load_this(Dst, EX_NUM_TO_VAR(i))) {
                                                return 0;
                                        }