* fix for Mantis #35965: correct alignment also for the class info used to retrieve the unit name

+ added test

git-svn-id: trunk@42697 -
This commit is contained in:
svenbarth 2019-08-15 13:29:19 +00:00
parent aa0422b2ed
commit 10af6fe2fb
3 changed files with 18 additions and 4 deletions

1
.gitattributes vendored
View File

@ -17787,6 +17787,7 @@ tests/webtbs/tw35937.pp svneol=native#text/plain
tests/webtbs/tw3594.pp svneol=native#text/plain
tests/webtbs/tw3595.pp svneol=native#text/plain
tests/webtbs/tw35953.pp svneol=native#text/pascal
tests/webtbs/tw35965.pp svneol=native#text/pascal
tests/webtbs/tw3612.pp svneol=native#text/plain
tests/webtbs/tw3617.pp svneol=native#text/plain
tests/webtbs/tw3619.pp svneol=native#text/plain

View File

@ -980,10 +980,17 @@
type
TClassTypeInfo = {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}packed{$endif}record
Attributes: Pointer;
ClassType: TClass;
ParentInfo: Pointer;
PropCount: SmallInt;
UnitName: ShortString;
case TTypeKind of
tkClass: (
ClassType: TClass;
ParentInfo: Pointer;
PropCount: SmallInt;
UnitName: ShortString;
);
{ include for proper alignment }
tkInt64: (
Dummy: Int64;
);
end;
PClassTypeInfo = ^TClassTypeInfo;
var

6
tests/webtbs/tw35965.pp Normal file
View File

@ -0,0 +1,6 @@
program tw35965;
begin
if TObject.UnitName <> 'System' then
Halt(1);
end.