summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-06-13 13:51:33 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-06-13 13:51:33 +0200
commit91a3cb67ec53f28c919316bf611bea07e8677d02 (patch)
treecbde76129eacda523da14dcdca6d6b068d9c9682
parent210955c3b6bfbb1d27c426f78cd9315bab2dd0ec (diff)
downloadNim-91a3cb67ec53f28c919316bf611bea07e8677d02.tar.gz
fixes #5824
-rw-r--r--compiler/ccgtypes.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 02eb5ba82..0c81ca814 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -470,7 +470,12 @@ proc genRecordFieldsAux(m: BModule, n: PNode,
           let a = genRecordFieldsAux(m, k, "$1.$2" % [ae, sname], rectype,
                                      check)
           if a != nil:
-            add(unionBody, "struct {")
+            if tfPacked notin rectype.flags:
+              add(unionBody, "struct {")
+            else:
+              addf(unionBody, CC[cCompiler].structStmtFmt,
+                [rope"struct", nil, rope(CC[cCompiler].packedPragma)])
+              add(unionBody, "{")
             add(unionBody, a)
             addf(unionBody, "} $1;$n", [sname])
         else: