mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:29:17 +02:00
* Force 4-byte alignment of fields in record-buffers hwn necessary
git-svn-id: trunk@11134 -
This commit is contained in:
parent
6274dd72d7
commit
8aa27c6254
@ -1807,12 +1807,20 @@ var x : longint;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
FNullmaskSize := 1+((FieldDefs.count-1) div 8);
|
FNullmaskSize := 1+((FieldDefs.count-1) div 8);
|
||||||
|
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||||
|
if (FNullmaskSize and 3 <> 0) then
|
||||||
|
FNullmaskSize := (FNullmaskSize and not 3)+4;
|
||||||
|
{$ENDIF}
|
||||||
FRecordSize := FNullmaskSize;
|
FRecordSize := FNullmaskSize;
|
||||||
SetLength(FFieldBufPositions,FieldDefs.count);
|
SetLength(FFieldBufPositions,FieldDefs.count);
|
||||||
for x := 0 to FieldDefs.count-1 do
|
for x := 0 to FieldDefs.count-1 do
|
||||||
begin
|
begin
|
||||||
FFieldBufPositions[x] := FRecordSize;
|
FFieldBufPositions[x] := FRecordSize;
|
||||||
inc(FRecordSize, GetFieldSize(FieldDefs[x]));
|
inc(FRecordSize, GetFieldSize(FieldDefs[x]));
|
||||||
|
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||||
|
if (FRecordSize and 3 <> 0) then
|
||||||
|
FRecordSize := (FRecordSize and not 3)+4;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user