mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Zend/zend_type_code: remove hard-coded integer values and
remove unused macro ZEND_SAME_FAKE_TYPE
Zend/zend_variables: add _Static_assert on the size zend_rc_dtor_func
_Static_assert is C11, but has been supported since GCC 4.6.
Also removing the comment about keeping those values in sync with
`zend_variables.c` which was obsoleted by commit 0460420205
(designated initializers).
Closes GH-10714.
This commit is contained in:
parent
3db32439f9
commit
c7637ed1c0
2 changed files with 40 additions and 30 deletions
|
@ -51,6 +51,11 @@ static const zend_rc_dtor_func_t zend_rc_dtor_func[] = {
|
|||
[IS_CONSTANT_AST] = (zend_rc_dtor_func_t)zend_ast_ref_destroy
|
||||
};
|
||||
|
||||
#if ZEND_GCC_VERSION >= 4006 || defined(__clang__)
|
||||
_Static_assert(sizeof(zend_rc_dtor_func) / sizeof(zend_rc_dtor_func[0]) == _IS_REGULAR_END,
|
||||
"zend_rc_dtor_func has the wrong size");
|
||||
#endif
|
||||
|
||||
ZEND_API void ZEND_FASTCALL rc_dtor_func(zend_refcounted *p)
|
||||
{
|
||||
ZEND_ASSERT(GC_TYPE(p) <= IS_CONSTANT_AST);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue