Browse Source

* to determine the alignment of arrays of orddef, enumdef and floatdef,
use the alignment of these elements rather than their size (fixes
alignment of arrays of int64/qword/double on darwin/i386 and darwin/arm)

git-svn-id: trunk@13068 -

Jonas Maebe 16 years ago
parent
commit
844e0d04ba
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/symdef.pas

+ 3 - 2
compiler/symdef.pas

@@ -2399,11 +2399,12 @@ implementation
          { alignment of dyn. arrays doesn't depend on the element size }
          { alignment of dyn. arrays doesn't depend on the element size }
          if (ado_IsDynamicArray in arrayoptions) then
          if (ado_IsDynamicArray in arrayoptions) then
            alignment:=size_2_align(sizeof(pint))
            alignment:=size_2_align(sizeof(pint))
-         { alignment is the size of the elements }
-         else if (elementdef.typ in [arraydef,recorddef]) or
+         { alignment is the alignment of the elements }
+         else if (elementdef.typ in [arraydef,recorddef,orddef,enumdef,floatdef]) or
            ((elementdef.typ=objectdef) and
            ((elementdef.typ=objectdef) and
              is_object(elementdef)) then
              is_object(elementdef)) then
            alignment:=elementdef.alignment
            alignment:=elementdef.alignment
+         { alignment is the size of the elements }
          else if not (ado_IsBitPacked in arrayoptions) then
          else if not (ado_IsBitPacked in arrayoptions) then
            alignment:=size_2_align(elesize)
            alignment:=size_2_align(elesize)
          else
          else