From: Nikita Popov Date: Mon, 1 Jul 2019 08:15:06 +0000 (+0200) Subject: Undef opline result on mod/shift error in jit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a8fe02c7c17d3d4427e9b0097ac72ed6bc163f7;p=php Undef opline result on mod/shift error in jit --- diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 29cd6e22d3..7a46588e90 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -506,6 +506,16 @@ static void* dasm_labels[zend_lb_MAX]; | mov dword [Ra(Z_REG(addr))+Z_OFFSET(addr)+4], val |.endmacro +|.macro UNDEF_OPLINE_RESULT +| mov r0, EX->opline +|.if X64 + | movsxd r0, dword OP:r0->result.var +|.else + | mov r0, OP:r0->result.var +|.endif +| SET_Z_TYPE_INFO FP + r0, IS_UNDEF +|.endmacro + |.macro FPU_OP, fp_ins, addr || if (Z_MODE(addr) == IS_CONST_ZVAL) { | MEM_OP1 fp_ins, qword, Z_ZV(addr), r0 @@ -2179,6 +2189,7 @@ static int zend_jit_undefined_function_stub(dasm_State **Dst) static int zend_jit_negative_shift_stub(dasm_State **Dst) { |->negative_shift: + | UNDEF_OPLINE_RESULT |.if X64 |.if WIN | LOAD_ADDR CARG1, &zend_ce_arithmetic_error @@ -2207,6 +2218,7 @@ static int zend_jit_negative_shift_stub(dasm_State **Dst) static int zend_jit_mod_by_zero_stub(dasm_State **Dst) { |->mod_by_zero: + | UNDEF_OPLINE_RESULT |.if X64 |.if WIN | LOAD_ADDR CARG1, &zend_ce_division_by_zero_error