From: Ondřej Surý Date: Tue, 26 Sep 2023 12:29:54 +0000 (+0200) Subject: Workaround compiler bug that optimizes setting .free_pools X-Git-Tag: v9.19.18~63^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca912775a5dab1bf6a56247424f228ae70e512e7;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/dns/message.c b/lib/dns/message.c index 7f8ffc76d14..5ec09c6f7da 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);