mirror of git://sourceware.org/git/glibc.git
nptl: Check alignment of pthread structs
Report assertion failure if the alignment of external pthread structs is lower than the internal version. This triggers on type mismatches like in BZ #33632. Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
This commit is contained in:
parent
f9bb6bcff6
commit
83dd79dffb
|
|
@ -698,9 +698,11 @@ check_stacksize_attr (size_t st)
|
|||
_Static_assert (sizeof (type) == size, \
|
||||
"sizeof (" #type ") != " #size)
|
||||
|
||||
#define ASSERT_PTHREAD_INTERNAL_SIZE(type, internal) \
|
||||
_Static_assert (sizeof ((type) { { 0 } }).__size >= sizeof (internal),\
|
||||
"sizeof (" #type ".__size) < sizeof (" #internal ")")
|
||||
#define ASSERT_PTHREAD_INTERNAL_SIZE(type, internal) \
|
||||
{ _Static_assert (sizeof ((type) { { 0 } }).__size >= sizeof (internal), \
|
||||
"sizeof (" #type ".__size) < sizeof (" #internal ")"); \
|
||||
_Static_assert (_Alignof (type) >= _Alignof (internal), \
|
||||
"_Aignof (" #type ") < _Alignof (" #internal ")"); }
|
||||
|
||||
#define ASSERT_PTHREAD_STRING(x) __STRING (x)
|
||||
#define ASSERT_PTHREAD_INTERNAL_OFFSET(type, member, offset) \
|
||||
|
|
|
|||
Loading…
Reference in New Issue