From: Nikita Popov Date: Thu, 13 Jun 2019 09:53:31 +0000 (+0200) Subject: Fix bug #78154 with JIT X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=792e38d863a84ed44970a142339ecfe1b40aea8a;p=php Fix bug #78154 with JIT --- diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 231870de73..98da0523b5 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -1635,3 +1635,9 @@ static void ZEND_FASTCALL zend_jit_post_dec_typed_ref(zval *var_ptr, zend_refere ZVAL_COPY_VALUE(var_ptr, ret); } } + +static void ZEND_FASTCALL zend_jit_only_vars_by_reference(zval *arg) +{ + ZVAL_NEW_REF(arg, arg); + zend_error(E_NOTICE, "Only variables should be passed by reference"); +} diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 714abe2cc2..1d57ea30bb 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -8023,14 +8023,12 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, zend_op_ar | jnz >7 | SAVE_VALID_OPLINE opline |.if X64 - | mov CARG1, E_NOTICE - | LOAD_ADDR CARG2, "Only variables should be passed by reference" - | EXT_CALL zend_error, r0 + | LOAD_ZVAL_ADDR CARG1, arg_addr + | EXT_CALL zend_jit_only_vars_by_reference, r0 |.else | sub r4, 8 - | push "Only variables should be passed by reference" - | push E_NOTICE - | EXT_CALL zend_error, r0 + | PUSH_ZVAL_ADDR arg_addr, r0 + | EXT_CALL zend_jit_only_vars_by_reference, r0 | add r4, 16 |.endif if (!zend_jit_check_exception(Dst)) { @@ -8070,14 +8068,12 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, zend_op_ar } | SAVE_VALID_OPLINE opline |.if X64 - | mov CARG1, E_NOTICE - | LOAD_ADDR CARG2, "Only variables should be passed by reference" - | EXT_CALL zend_error, r0 + | LOAD_ZVAL_ADDR CARG1, arg_addr + | EXT_CALL zend_jit_only_vars_by_reference, r0 |.else | sub r4, 8 - | push "Only variables should be passed by reference" - | push E_NOTICE - | EXT_CALL zend_error, r0 + | PUSH_ZVAL_ADDR arg_addr, r0 + | EXT_CALL zend_jit_only_vars_by_reference, r0 | add r4, 16 |.endif if (!zend_jit_check_exception(Dst)) {