From ca912775a5dab1bf6a56247424f228ae70e512e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 26 Sep 2023 14:29:54 +0200 Subject: [PATCH] Workaround compiler bug that optimizes setting .free_pools The .free_pools bitfield would not be set on some levels of optimizations - workaround the compiler bug by reordering the setting the .freepools in the initializer. --- lib/dns/message.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dns/message.c b/lib/dns/message.c index 7f8ffc76d1..5ec09c6f7d 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -725,13 +725,13 @@ dns_message_create(isc_mem_t *mctx, isc_mempool_t *namepool, .magic = DNS_MESSAGE_MAGIC, .namepool = namepool, .rdspool = rdspool, + .free_pools = (namepool == NULL && rdspool == NULL), }; isc_mem_attach(mctx, &msg->mctx); - if (namepool == NULL && rdspool == NULL) { + if (msg->free_pools) { dns_message_createpools(mctx, &msg->namepool, &msg->rdspool); - msg->free_pools = true; } msginit(msg);