File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1143,10 +1143,15 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) {
1143
1143
1144
1144
#if ZEND_RC_DEBUG
1145
1145
extern ZEND_API bool zend_rc_debug ;
1146
+ /* The GC_PERSISTENT flag is reused for IS_OBJ_WEAKLY_REFERENCED on objects.
1147
+ * Skip checks for OBJECT/NULL type to avoid interpreting the flag incorrectly. */
1146
1148
# define ZEND_RC_MOD_CHECK (p ) do { \
1147
- if (zend_rc_debug && zval_gc_type((p)->u.type_info) != IS_OBJECT) { \
1148
- ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
1149
- ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \
1149
+ if (zend_rc_debug) { \
1150
+ zend_uchar type = zval_gc_type((p)->u.type_info); \
1151
+ if (type != IS_OBJECT && type != IS_NULL) { \
1152
+ ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
1153
+ ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \
1154
+ } \
1150
1155
} \
1151
1156
} while (0)
1152
1157
# define GC_MAKE_PERSISTENT_LOCAL (p ) do { \
You can’t perform that action at this time.
0 commit comments