]> granicus.if.org Git - php/commitdiff
Make "exception_handler_undef" stub to check EG(opline_before_exception) and undefine...
authorDmitry Stogov <dmitry@zend.com>
Tue, 17 Dec 2019 11:09:26 +0000 (14:09 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 17 Dec 2019 11:09:26 +0000 (14:09 +0300)
This fixes few invalid "exception_handler_undef" usages.

ext/opcache/jit/zend_jit_x86.dasc

index e48f406149b76a764cdae8c014c1078aa03826b5..e6d57616fac40922a3a8df7c807018ee0445f6ce 100644 (file)
@@ -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;
        }