Skip to content

Commit a77482d

Browse files
author
michael19
committed
#17725 rollback moving ZEND_TYPE_FULL_MASK to variable
1 parent 25184ce commit a77482d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Zend/zend_inheritance.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,8 @@ static inheritance_status zend_is_class_subtype_of_type(
477477
zend_class_entry *fe_ce = NULL;
478478
bool have_unresolved = 0;
479479

480-
uint32_t proto_type_full_mask = ZEND_TYPE_FULL_MASK(proto_type);
481-
482480
/* If the parent has 'object' as a return type, any class satisfies the co-variant check */
483-
if (proto_type_full_mask & MAY_BE_OBJECT) {
481+
if (ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_OBJECT) {
484482
/* Currently, any class name would be allowed here. We still perform a class lookup
485483
* for forward-compatibility reasons, as we may have named types in the future that
486484
* are not classes (such as typedefs). */
@@ -494,7 +492,7 @@ static inheritance_status zend_is_class_subtype_of_type(
494492
}
495493

496494
/* If the parent has 'callable' as a return type, then Closure satisfies the co-variant check */
497-
if (proto_type_full_mask & MAY_BE_CALLABLE) {
495+
if (ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_CALLABLE) {
498496
if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name);
499497
if (!fe_ce) {
500498
have_unresolved = 1;
@@ -575,7 +573,7 @@ static inheritance_status zend_is_class_subtype_of_type(
575573

576574
/* Replacing static with self in final classes is okay */
577575
if (!is_intersection && (fe_scope->ce_flags & ZEND_ACC_FINAL) &&
578-
(proto_type_full_mask & MAY_BE_STATIC) && unlinked_instanceof(fe_scope, proto_scope)) {
576+
(ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_STATIC) && unlinked_instanceof(fe_scope, proto_scope)) {
579577
if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name);
580578

581579
if (fe_ce == fe_scope) {

0 commit comments

Comments
 (0)