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()
27722772
27732773static zend_always_inline void zend_normalize_internal_type (zend_type * type ) {
27742774 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+ }
27752778 zend_type * current ;
27762779 ZEND_TYPE_FOREACH (* type , current ) {
27772780 if (ZEND_TYPE_HAS_NAME (* current )) {
@@ -4642,6 +4645,9 @@ ZEND_API zend_class_constant *zend_declare_typed_class_constant(zend_class_entry
46424645
46434646 if (ce -> type == ZEND_INTERNAL_CLASS ) {
46444647 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+ }
46454651 } else {
46464652 c = zend_arena_alloc (& CG (arena ), sizeof (zend_class_constant ));
46474653 }
You can’t perform that action at this time.
0 commit comments