From: Dmitry Stogov Date: Tue, 17 Dec 2019 11:09:26 +0000 (+0300) Subject: Make "exception_handler_undef" stub to check EG(opline_before_exception) and undefine... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97bba4ffd6dc57cc6b6becc3a9f8306b77845e4d;p=php Make "exception_handler_undef" stub to check EG(opline_before_exception) and undefine corresponnding result variable, if necessary. This fixes few invalid "exception_handler_undef" usages. --- diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index e48f406149..e6d57616fa 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -1714,7 +1714,16 @@ static int zend_jit_exception_handler_stub(dasm_State **Dst) static int zend_jit_exception_handler_undef_stub(dasm_State **Dst) { |->exception_handler_undef: + | MEM_OP2_2_ZTS mov, r0, aword, executor_globals, opline_before_exception, r0 + | test byte OP:r0->result_type, (IS_TMP_VAR|IS_VAR) + | jnz >1 + | .if X64 + | movsxd r0, dword OP:r0->result.var + | .else + | mov r0, aword OP:r0->result.var + | .endif | SET_Z_TYPE_INFO FP + r0, IS_UNDEF + |1: | jmp ->exception_handler return 1; @@ -2547,7 +2556,6 @@ static int zend_jit_check_exception_undef_result(dasm_State **Dst, const zend_op { if (opline->result_type & (IS_TMP_VAR|IS_VAR)) { | MEM_OP2_1_ZTS cmp, aword, executor_globals, exception, 0, r0 - | mov r0, opline->result.var | jne ->exception_handler_undef return 1; }