1
0
mirror of https://github.com/php/php-src.git synced 2026-04-01 21:22:13 +02:00

JIT: improved code for protected properties access

This commit is contained in:
Dmitry Stogov
2021-09-07 13:18:14 +03:00
parent 1bb6cf5396
commit aed94e2ca8

View File

@@ -640,12 +640,18 @@ static zend_property_info* zend_get_known_property_info(const zend_op_array *op_
return NULL;
}
if (!(info->flags & ZEND_ACC_PUBLIC) &&
(!on_this || info->ce != ce)) {
return NULL;
if (info->flags & ZEND_ACC_PUBLIC) {
return info;
} else if (on_this) {
if (ce == info->ce) {
return info;
} else if ((info->flags & ZEND_ACC_PROTECTED)
&& instanceof_function_slow(ce, info->ce)) {
return info;
}
}
return info;
return NULL;
}
static bool zend_may_be_dynamic_property(zend_class_entry *ce, zend_string *member, bool on_this, zend_string *filename)