From 586ccfdfd5179336dcf3719577b8258e55e7d76e Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 23 Nov 2020 14:42:38 +0300 Subject: [PATCH] Fixed use-after-free in PHPUnit tests --- ext/opcache/jit/zend_jit_trace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index e50a418f44..8e01c73162 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -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; } -- 2.40.0