Skip to content

Commit 88a701a

Browse files
committed
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.
1 parent 0da38cd commit 88a701a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8463,17 +8463,15 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
84638463
|1:
84648464

84658465
if (!RETURN_VALUE_USED(opline)) {
8466-
#if 0
8467-
/* If an exception is thrown, then the value stored in the return_value slot
8468-
* may have a different type. */
84698466
zend_class_entry *ce;
84708467
zend_bool ce_is_instanceof;
84718468
uint32_t func_info = call_info ?
84728469
zend_get_func_info(call_info, ssa, &ce, &ce_is_instanceof) :
84738470
(MAY_BE_ANY|MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN);
8474-
#else
8475-
uint32_t func_info = (MAY_BE_ANY|MAY_BE_REF|MAY_BE_RC1|MAY_BE_RCN);
8476-
#endif
8471+
8472+
/* If an exception is thrown, the return_value may stay at the
8473+
* original value of null. */
8474+
func_info |= MAY_BE_NULL;
84778475

84788476
if (func_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) {
84798477
| ZVAL_PTR_DTOR res_addr, func_info, 1, 1, opline

0 commit comments

Comments
 (0)