infra: tighten list checking

This commit is contained in:
Thomas Schoebel-Theuer 2023-05-11 10:44:13 +02:00
parent 732dbc7a75
commit f102c3094f

View File

@ -50,7 +50,11 @@ do { \
#define CHECK_HEAD_EMPTY(head) \
do { \
if (BRICK_CHECKING && unlikely(!list_empty(head) && (head)->next)) { \
if (BRICK_CHECKING && \
unlikely(!list_empty(head) && \
(head)->next && \
(head)->next != LIST_POISON1 && \
(head)->prev != LIST_POISON2)) { \
list_del_init(head); \
BRICK_ERR("%d: list_head " #head " (%p) not empty\n", __LINE__, head); \
} \