com php-src: Fix verify type jit for complex type masks: ext/opcache/jit/zend_jit_x86.dasc
| From: | Nikita Popov | Date: | Mon, 27 Jul 2020 13:54:22 +0000 |
| Subject: | com php-src: Fix verify type jit for complex type masks: ext/opcache/jit/zend_jit_x86.dasc | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112383@lists.php.net to get a copy of this message | ||
Commit: f9f61239413aaacb78adc17946ac73d2f80bd382
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 27 Jul 2020 15:52:43 +0200
Parents: e0aa2724c3d4acd4d934bdb97630e9888cb4fb31
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f9f61239413aaacb78adc17946ac73d2f80bd382
Log:
Fix verify type jit for complex type masks
We should not try to check things like MAY_BE_CALLABLE in the fast
path, because those aren't real types. This is only actively wrong
for the concrete_type case, for the mask case it just uses an
unnecessarily large immediate.
Changed paths:
M ext/opcache/jit/zend_jit_x86.dasc
Diff:
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index f9690b3e7c..f4c011dbbf 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -10891,7 +10891,7 @@ static int zend_jit_verify_arg_type(dasm_State **Dst, const zend_op *opline,
zen
{
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
zend_bool in_cold = 0;
- uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type);
+ uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY;
zend_reg tmp_reg = (type_mask == 0 || is_power_of_two(type_mask)) ? ZREG_FCARG1a : ZREG_R0;
if (ZEND_ARG_SEND_MODE(arg_info)) {
@@ -12029,7 +12029,7 @@ static zend_bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op
*op
| LOAD_ZVAL_ADDR r0, op1_addr
- uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type);
+ uint32_t type_mask = ZEND_TYPE_PURE_MASK(arg_info->type) & MAY_BE_ANY;
if (type_mask == 0) {
| jmp >7
} else if (is_power_of_two(type_mask)) {