From 88a701aa02ac44d0f4d6cd3dc74ca56e2058d0dc Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 28 Apr 2020 15:55:02 +0200 Subject: [PATCH] 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. --- ext/opcache/jit/zend_jit_x86.dasc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index b9a0557aee..aac0e44f3c 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -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 -- 2.50.1