mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 02:28:14 +02:00
23 lines
357 B
ObjectPascal
23 lines
357 B
ObjectPascal
{$mode objfpc}
|
|
|
|
type
|
|
TMyObject = object
|
|
Int: longint;
|
|
end;
|
|
|
|
TMyObject2 = object(TMyObject)
|
|
end;
|
|
|
|
TMyClass = class
|
|
FByte: byte;
|
|
Obj: TMyObject2; // instance of this object is not aligned
|
|
end;
|
|
|
|
var
|
|
myclass: TMyClass;
|
|
begin
|
|
myclass:=TMyClass.Create;
|
|
myclass.obj.int:=1; // Crash due to unaligned data access
|
|
myclass.Free;
|
|
end.
|