Browse Source

* fixed field alignment when reusing an anonymous recorddef for LLVM and
the LLVM layout of an instance does not match the original one
(e.g. because it contains procdefs of procedures with different
signatures)

git-svn-id: trunk@42477 -

Jonas Maebe 6 năm trước cách đây
mục cha
commit
e7fbebfef5
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      compiler/llvm/nllvmtcon.pas

+ 6 - 3
compiler/llvm/nllvmtcon.pas

@@ -388,9 +388,12 @@ implementation
               newdef:=crecorddef.create_global_internal('',1,1);
             recorddef,
             objectdef:
-              newdef:=crecorddef.create_global_internal('',
-                tabstractrecordsymtable(tabstractrecorddef(info.def).symtable).recordalignment,
-                tabstractrecordsymtable(tabstractrecorddef(info.def).symtable).recordalignmin);
+              begin
+                newdef:=crecorddef.create_global_internal('',
+                  tabstractrecordsymtable(tabstractrecorddef(info.def).symtable).usefieldalignment,
+                  tabstractrecordsymtable(tabstractrecorddef(info.def).symtable).recordalignmin);
+                tabstractrecordsymtable(newdef.symtable).recordalignment:=tabstractrecordsymtable(tabstractrecorddef(info.def).symtable).recordalignment;
+              end
             else
               internalerror(2015122401);
           end;