File tree 3 files changed +21
-28
lines changed
3 files changed +21
-28
lines changed Original file line number Diff line number Diff line change @@ -255,31 +255,22 @@ define ____printzv_contents
255
255
printf " CONSTANT_AST"
256
256
end
257
257
if $type == 12
258
- printf " CALLABLE"
259
- end
260
- if $type == 13
261
- printf " ITERABLE"
262
- end
263
- if $type == 14
264
- printf " VOID"
265
- end
266
- if $type == 15
267
258
printf " indirect: "
268
259
____printzv $zvalue ->value.zv $arg1
269
260
end
270
- if $type == 16
261
+ if $type == 13
271
262
printf " pointer: %p" , $zvalue ->value.ptr
272
263
end
273
- if $type == 17
264
+ if $type == 15
274
265
printf " _ERROR"
275
266
end
276
- if $type == 18
267
+ if $type == 16
277
268
printf " _BOOL"
278
269
end
279
- if $type == 19
270
+ if $type == 17
280
271
printf " _NUMBER"
281
272
end
282
- if $type > 19
273
+ if $type > 17
283
274
printf " unknown type %d" , $type
284
275
end
285
276
printf " \n "
Original file line number Diff line number Diff line change 35
35
#define MAY_BE_ANY (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)
36
36
#define MAY_BE_REF (1 << IS_REFERENCE) /* may be reference */
37
37
38
- /* These are used in zend_type, but not for type inference. */
38
+ /* These are used in zend_type, but not for type inference.
39
+ * They are allowed to overlap with types used during inference. */
39
40
#define MAY_BE_CALLABLE (1 << IS_CALLABLE)
40
41
#define MAY_BE_ITERABLE (1 << IS_ITERABLE)
41
42
#define MAY_BE_VOID (1 << IS_VOID)
42
43
43
- #define MAY_BE_ARRAY_SHIFT (IS_VOID )
44
+ #define MAY_BE_ARRAY_SHIFT (IS_REFERENCE )
44
45
45
46
#define MAY_BE_ARRAY_OF_NULL (MAY_BE_NULL << MAY_BE_ARRAY_SHIFT)
46
47
#define MAY_BE_ARRAY_OF_FALSE (MAY_BE_FALSE << MAY_BE_ARRAY_SHIFT)
54
55
#define MAY_BE_ARRAY_OF_ANY (MAY_BE_ANY << MAY_BE_ARRAY_SHIFT)
55
56
#define MAY_BE_ARRAY_OF_REF (MAY_BE_REF << MAY_BE_ARRAY_SHIFT)
56
57
57
- #define MAY_BE_ARRAY_KEY_LONG (1<<25 )
58
- #define MAY_BE_ARRAY_KEY_STRING (1<<26 )
58
+ #define MAY_BE_ARRAY_KEY_LONG (1<<21 )
59
+ #define MAY_BE_ARRAY_KEY_STRING (1<<22 )
59
60
#define MAY_BE_ARRAY_KEY_ANY (MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_KEY_STRING)
60
61
61
- /* Bit 27 unused */
62
- #define MAY_BE_CLASS (1<<28)
62
+ #define MAY_BE_CLASS (1<<23)
63
63
64
64
#endif /* ZEND_TYPE_INFO_H */
Original file line number Diff line number Diff line change @@ -137,14 +137,15 @@ typedef struct {
137
137
138
138
#define _ZEND_TYPE_EXTRA_FLAGS_SHIFT 24
139
139
#define _ZEND_TYPE_MASK ((1u << 24) - 1)
140
- #define _ZEND_TYPE_MAY_BE_MASK ((1u << (IS_VOID+1)) - 1)
141
140
/* Only one of these bits may be set. */
142
141
#define _ZEND_TYPE_NAME_BIT (1u << 23)
143
142
#define _ZEND_TYPE_CE_BIT (1u << 22)
144
143
#define _ZEND_TYPE_LIST_BIT (1u << 21)
145
144
#define _ZEND_TYPE_KIND_MASK (_ZEND_TYPE_LIST_BIT|_ZEND_TYPE_CE_BIT|_ZEND_TYPE_NAME_BIT)
146
145
/* Whether the type list is arena allocated */
147
146
#define _ZEND_TYPE_ARENA_BIT (1u << 20)
147
+ /* Type mask excluding the flags above. */
148
+ #define _ZEND_TYPE_MAY_BE_MASK ((1u << 20) - 1)
148
149
/* Must have same value as MAY_BE_NULL */
149
150
#define _ZEND_TYPE_NULLABLE_BIT 0x2
150
151
@@ -533,20 +534,21 @@ struct _zend_ast_ref {
533
534
#define IS_REFERENCE 10
534
535
#define IS_CONSTANT_AST 11 /* Constant expressions */
535
536
536
- /* Fake types used only for type hinting. IS_VOID should be the last. */
537
+ /* Fake types used only for type hinting.
538
+ * These are allowed to overlap with the types below. */
537
539
#define IS_CALLABLE 12
538
540
#define IS_ITERABLE 13
539
541
#define IS_VOID 14
540
542
541
543
/* internal types */
542
- #define IS_INDIRECT 15
543
- #define IS_PTR 16
544
- #define IS_ALIAS_PTR 17
545
- #define _IS_ERROR 17
544
+ #define IS_INDIRECT 12
545
+ #define IS_PTR 13
546
+ #define IS_ALIAS_PTR 14
547
+ #define _IS_ERROR 15
546
548
547
549
/* used for casts */
548
- #define _IS_BOOL 18
549
- #define _IS_NUMBER 19
550
+ #define _IS_BOOL 16
551
+ #define _IS_NUMBER 17
550
552
551
553
static zend_always_inline zend_uchar zval_get_type (const zval * pz ) {
552
554
return pz -> u1 .v .type ;
You can’t perform that action at this time.
0 commit comments