From b7b1003e6a2a79aa99e4f91272424b7339a9d205 Mon Sep 17 00:00:00 2001 From: metagn Date: Thu, 21 Nov 2024 14:29:18 +0300 Subject: [PATCH] fix #pragma pack generation regression in packed case objects (#24461) Regression in #24145 --- compiler/cbuilderdecls.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cbuilderdecls.nim b/compiler/cbuilderdecls.nim index 5919ae8a91..0b170c7183 100644 --- a/compiler/cbuilderdecls.nim +++ b/compiler/cbuilderdecls.nim @@ -373,7 +373,7 @@ template addFieldWithStructType(obj: var Builder; m: BModule; parentTyp: PType; obj.add(fieldName) obj.add(";\n") if tfPacked in parentTyp.flags and hasAttribute notin CC[m.config.cCompiler].props: - result.add("#pragma pack(pop)\n") + obj.add("#pragma pack(pop)\n") template addAnonUnion(obj: var Builder; body: typed) = ## adds an anonymous union i.e. `union { ... };` with fields according to `body`