From: Nikita Popov Date: Tue, 28 Apr 2020 13:43:52 +0000 (+0200) Subject: Fix JIT segfaults in FFI tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0da38cda6e7d2c181bdff02838b7ff755b1d6177;p=php Fix JIT segfaults in FFI tests Conservative fix that just disables this optimization. --- diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 047287b006..b9a0557aee 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -8463,11 +8463,17 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend |1: if (!RETURN_VALUE_USED(opline)) { +#if 0 + /* If an exception is thrown, then the value stored in the return_value slot + * may have a different type. */ zend_class_entry *ce; zend_bool ce_is_instanceof; uint32_t func_info = call_info ? zend_get_func_info(call_info, ssa, &ce, &ce_is_instanceof) : (MAY_BE_ANY|MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN); +#else + uint32_t func_info = (MAY_BE_ANY|MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN); +#endif if (func_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) { | ZVAL_PTR_DTOR res_addr, func_info, 1, 1, opline