From d6d3e171ceabb0e194e8ecd5de51b6cfdc1922a3 Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 1 Aug 2019 14:46:56 +0000 Subject: [PATCH] Try to fix alignment issues in RTTI code for 64-bit targets which require proper alignment git-svn-id: trunk@42549 - --- rtl/inc/rtti.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl/inc/rtti.inc b/rtl/inc/rtti.inc index 57d64a7b24..34c82c88b8 100644 --- a/rtl/inc/rtti.inc +++ b/rtl/inc/rtti.inc @@ -128,7 +128,7 @@ begin {$endif VER3_0} Count:=PRecordInfoInit(typeInfo)^.Count; { Get element info, hacky, but what else can we do? } - typeInfo:=Pointer(@PRecordInfoInit(typeInfo)^.Count)+SizeOf(PRecordInfoInit(typeInfo)^.Count); + typeInfo:=aligntoptr(Pointer(@PRecordInfoInit(typeInfo)^.Count)+SizeOf(PRecordInfoInit(typeInfo)^.Count)); { Process elements } for i:=1 to count Do begin @@ -404,7 +404,7 @@ begin Result:=PRecordInfoInit(Temp)^.Size; EleCount:=PRecordInfoInit(Temp)^.Count; { Get element info, hacky, but what else can we do? } - Temp:=Pointer(@PRecordInfoInit(Temp)^.Count)+SizeOf(PRecordInfoInit(Temp)^.Count); + Temp:=aligntoptr(Pointer(@PRecordInfoInit(Temp)^.Count)+SizeOf(PRecordInfoInit(Temp)^.Count)); {$else VER3_0} Result:=PRecordInfoFull(Temp)^.Size; EleCount:=PRecordInfoFull(Temp)^.Count;