Browse Source

* set alignment for 0-byte sized entities to 1 instead of to 0

git-svn-id: trunk@12931 -
Jonas Maebe 16 years ago
parent
commit
c04e9e36f7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      compiler/symdef.pas

+ 5 - 0
compiler/symdef.pas

@@ -1069,6 +1069,11 @@ implementation
       begin
       begin
          { natural alignment by default }
          { natural alignment by default }
          alignment:=size_2_align(savesize);
          alignment:=size_2_align(savesize);
+         { can happen if savesize = 0, e.g. for voiddef or
+           an empty record
+         }
+         if (alignment=0) then
+           alignment:=1;
       end;
       end;