Skip to content

Commit fbf153a

Browse files
committed
Fixed possible incorrect register usage
1 parent d7243ce commit fbf153a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4797,7 +4797,12 @@ static int zend_jit_long_math_helper(dasm_State **Dst,
47974797
if (opcode == ZEND_MOD) {
47984798
result_reg = ZREG_RAX;
47994799
} else if (Z_MODE(res_addr) == IS_REG) {
4800-
result_reg = Z_REG(res_addr);
4800+
if ((opline->opcode == ZEND_SL || opline->opcode == ZEND_SR)
4801+
&& opline->op2_type != IS_CONST) {
4802+
result_reg = ZREG_R0;
4803+
} else {
4804+
result_reg = Z_REG(res_addr);
4805+
}
48014806
} else if (Z_MODE(op1_addr) == IS_REG && Z_LAST_USE(op1_addr)) {
48024807
result_reg = Z_REG(op1_addr);
48034808
} else if (Z_REG(res_addr) != ZREG_R0) {

0 commit comments

Comments
 (0)