From fbf153a21015e93921ddfcda62a51ee7cf860c41 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 2 Oct 2020 10:48:45 +0300 Subject: [PATCH] Fixed possible incorrect register usage --- ext/opcache/jit/zend_jit_x86.dasc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 09143b2119..eab4293a7d 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -4797,7 +4797,12 @@ static int zend_jit_long_math_helper(dasm_State **Dst, if (opcode == ZEND_MOD) { result_reg = ZREG_RAX; } else if (Z_MODE(res_addr) == IS_REG) { - result_reg = Z_REG(res_addr); + if ((opline->opcode == ZEND_SL || opline->opcode == ZEND_SR) + && opline->op2_type != IS_CONST) { + result_reg = ZREG_R0; + } else { + result_reg = Z_REG(res_addr); + } } else if (Z_MODE(op1_addr) == IS_REG && Z_LAST_USE(op1_addr)) { result_reg = Z_REG(op1_addr); } else if (Z_REG(res_addr) != ZREG_R0) { -- 2.50.1