Skip to content

Commit 7800e33

Browse files
committed
Deep copy property types
1 parent 3fe6d27 commit 7800e33

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Zend/zend_inheritance.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,15 +2938,8 @@ static zend_class_entry *zend_lazy_class_load(zend_class_entry *pce)
29382938
Z_PTR(p->val) = new_prop_info;
29392939
memcpy(new_prop_info, prop_info, sizeof(zend_property_info));
29402940
new_prop_info->ce = ce;
2941-
if (ZEND_TYPE_HAS_LIST(new_prop_info->type)) {
2942-
zend_type_list *new_list;
2943-
zend_type_list *list = ZEND_TYPE_LIST(new_prop_info->type);
2944-
2945-
new_list = zend_arena_alloc(&CG(arena), ZEND_TYPE_LIST_SIZE(list->num_types));
2946-
memcpy(new_list, list, ZEND_TYPE_LIST_SIZE(list->num_types));
2947-
ZEND_TYPE_SET_PTR(new_prop_info->type, list);
2948-
ZEND_TYPE_FULL_MASK(new_prop_info->type) |= _ZEND_TYPE_ARENA_BIT;
2949-
}
2941+
/* Deep copy the type information */
2942+
zend_type_copy_ctor(&new_prop_info->type, /* use_arena */ true, /* persistent */ false);
29502943
}
29512944
}
29522945

0 commit comments

Comments
 (0)