Răsfoiți Sursa

* for proper alignment in arrays of text, text should be a multiple of 4 in size on 32 bit platforms

git-svn-id: trunk@21956 -
florian 13 ani în urmă
părinte
comite
c2eb030632
2 a modificat fișierele cu 7 adăugiri și 2 ștergeri
  1. 1 1
      compiler/symdef.pas
  2. 6 1
      rtl/inc/textrec.inc

+ 1 - 1
compiler/symdef.pas

@@ -2460,7 +2460,7 @@ implementation
 {$ifdef cpu32bitaddr}
 {$ifdef cpu32bitaddr}
         case filetyp of
         case filetyp of
           ft_text :
           ft_text :
-            savesize:=594{+4};
+            savesize:=596; { keep this dividable by 4 for proper alignment of arrays of text, see tw0754 e.g. on arm }
           ft_typed,
           ft_typed,
           ft_untyped :
           ft_untyped :
             savesize:=332;
             savesize:=332;

+ 6 - 1
rtl/inc/textrec.inc

@@ -4,7 +4,6 @@
 
 
     Textrec record definition
     Textrec record definition
 
 
-
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -45,5 +44,11 @@ type
 {$ifdef FPC_HAS_CPSTRING}
 {$ifdef FPC_HAS_CPSTRING}
     CodePage  : TSystemCodePage;
     CodePage  : TSystemCodePage;
 {$endif}
 {$endif}
+{$ifndef VER2_6}
+{$ifdef CPU32}
+    { keep textrec size divedable by 4 for proper alignment of arrays of text, see tw0754 e.g. on arm }
+    Dummy : Word;
+{$endif CPU32}
+{$endif VER2_6}
   End;
   End;