]> granicus.if.org Git - php/commitdiff
Check that type is set in ZEND_TYPE_IS_MASK()
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 23 Sep 2019 17:41:00 +0000 (19:41 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 23 Sep 2019 17:43:27 +0000 (19:43 +0200)
Allow this macro to be used without an explicit ZEND_TYPE_IS_SET()
check.

Zend/zend_types.h

index a7fa6fef5a6ac5c2f69a7933c5ff59c39bbcbc7e..8d2726a14c551b0d722ccd6d4251a7cf4560c7b5 100644 (file)
@@ -132,7 +132,7 @@ typedef uintptr_t zend_type;
        ((t) != 0)
 
 #define ZEND_TYPE_IS_MASK(t) \
-       ((t) <= _ZEND_TYPE_CODE_MAX)
+       ((t) != 0 && (t) <= _ZEND_TYPE_CODE_MAX)
 
 #define ZEND_TYPE_IS_CLASS(t) \
        ((t) > _ZEND_TYPE_CODE_MAX)