File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2772,6 +2772,9 @@ ZEND_END_ARG_INFO()
2772
2772
2773
2773
static zend_always_inline void zend_normalize_internal_type (zend_type * type ) {
2774
2774
ZEND_ASSERT (!ZEND_TYPE_HAS_LITERAL_NAME (* type ));
2775
+ if (ZEND_TYPE_PURE_MASK (* type ) != MAY_BE_ANY ) {
2776
+ ZEND_ASSERT (!ZEND_TYPE_CONTAINS_CODE (* type , IS_RESOURCE ) && "resource is not allowed in a zend_type" );
2777
+ }
2775
2778
zend_type * current ;
2776
2779
ZEND_TYPE_FOREACH (* type , current ) {
2777
2780
if (ZEND_TYPE_HAS_NAME (* current )) {
@@ -4642,6 +4645,9 @@ ZEND_API zend_class_constant *zend_declare_typed_class_constant(zend_class_entry
4642
4645
4643
4646
if (ce -> type == ZEND_INTERNAL_CLASS ) {
4644
4647
c = pemalloc (sizeof (zend_class_constant ), 1 );
4648
+ if (ZEND_TYPE_PURE_MASK (type ) != MAY_BE_ANY ) {
4649
+ ZEND_ASSERT (!ZEND_TYPE_CONTAINS_CODE (type , IS_RESOURCE ) && "resource is not allowed in a zend_type" );
4650
+ }
4645
4651
} else {
4646
4652
c = zend_arena_alloc (& CG (arena ), sizeof (zend_class_constant ));
4647
4653
}
You can’t perform that action at this time.
0 commit comments