瀏覽代碼

* base the default alignment on voidpointertype.alignment instead of
voidpointertype.size for all types, that are internally represented as a
pointer (ansi/widestrings,dynarrays,classes)

git-svn-id: trunk@30683 -

nickysn 10 年之前
父節點
當前提交
8cf469e9ef
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      compiler/symdef.pas

+ 3 - 3
compiler/symdef.pas

@@ -2290,7 +2290,7 @@ implementation
           st_unicodestring,
           st_widestring,
           st_ansistring:
-            alignment:=size_2_align(size);
+            alignment:=voidpointertype.alignment;
           st_longstring,
           st_shortstring:
               { char to string accesses byte 0 and 1 with one word access }
@@ -3579,7 +3579,7 @@ implementation
       begin
          { alignment of dyn. arrays doesn't depend on the element size }
          if (ado_IsDynamicArray in arrayoptions) then
-           alignment:=size_2_align(voidpointertype.size)
+           alignment:=voidpointertype.alignment
          { alignment is the target alignment for the used load size }
          else if (ado_IsBitPacked in arrayoptions) and
             (elementdef.typ in [enumdef,orddef]) then
@@ -6580,7 +6580,7 @@ implementation
     function tobjectdef.alignment:shortint;
       begin
         if objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcclass,odt_objcprotocol,odt_helper,odt_javaclass,odt_interfacejava] then
-          alignment:=voidpointertype.size
+          alignment:=voidpointertype.alignment
         else
           alignment:=tObjectSymtable(symtable).recordalignment;
       end;