Skip to content

Commit 59a4590

Browse files
committed
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.
1 parent c553c3f commit 59a4590

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_variables.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ static const zend_rc_dtor_func_t zend_rc_dtor_func[] = {
5151
[IS_CONSTANT_AST] = (zend_rc_dtor_func_t)zend_ast_ref_destroy
5252
};
5353

54+
#if ZEND_GCC_VERSION >= 4006
55+
_Static_assert(sizeof(zend_rc_dtor_func) / sizeof(zend_rc_dtor_func[0]) == _IS_REGULAR_END);
56+
#endif
57+
5458
ZEND_API void ZEND_FASTCALL rc_dtor_func(zend_refcounted *p)
5559
{
5660
ZEND_ASSERT(GC_TYPE(p) <= IS_CONSTANT_AST);

0 commit comments

Comments
 (0)