Less conservative fix

I think it's reasonable to assume that the only possible types
are those that are declared, and null, because null is what
return_value is initialized to.
This commit is contained in:
Nikita Popov 2020-04-28 15:55:02 +02:00
parent 0da38cda6e
commit 88a701aa02

View File

@ -8463,17 +8463,15 @@ 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 an exception is thrown, the return_value may stay at the
* original value of null. */
func_info |= MAY_BE_NULL;
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