Browse Source

* correct alignment for the result name/type

git-svn-id: trunk@42804 -
svenbarth 6 years ago
parent
commit
62e7bb6254
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/rtl-objpas/src/inc/rtti.pp

+ 4 - 4
packages/rtl-objpas/src/inc/rtti.pp

@@ -3298,7 +3298,7 @@ begin
   if not aWithHidden and (Length(FParams) > 0) then
   if not aWithHidden and (Length(FParams) > 0) then
     Exit(FParams);
     Exit(FParams);
 
 
-  ptr := AlignTParamFlags(@FTypeData^.ParamList[0]);
+  ptr := @FTypeData^.ParamList[0];
 
 
   visible := 0;
   visible := 0;
   total := 0;
   total := 0;
@@ -3307,6 +3307,8 @@ begin
     SetLength(infos, FTypeData^.ParamCount);
     SetLength(infos, FTypeData^.ParamCount);
 
 
     while total < FTypeData^.ParamCount do begin
     while total < FTypeData^.ParamCount do begin
+      { align }
+      ptr := AlignTParamFlags(ptr);
       infos[total].Handle := ptr;
       infos[total].Handle := ptr;
       infos[total].Flags := PParamFlags(ptr)^;
       infos[total].Flags := PParamFlags(ptr)^;
       Inc(ptr, SizeOf(TParamFlags));
       Inc(ptr, SizeOf(TParamFlags));
@@ -3315,8 +3317,6 @@ begin
       Inc(ptr, ptr^ + SizeOf(Byte));
       Inc(ptr, ptr^ + SizeOf(Byte));
       { skip type name }
       { skip type name }
       Inc(ptr, ptr^ + SizeOf(Byte));
       Inc(ptr, ptr^ + SizeOf(Byte));
-      { align }
-      ptr := AlignTParamFlags(ptr);
 
 
       if not (pfHidden in infos[total].Flags) then
       if not (pfHidden in infos[total].Flags) then
         Inc(visible);
         Inc(visible);
@@ -3326,7 +3326,7 @@ begin
 
 
   if FTypeData^.MethodKind in [mkFunction, mkClassFunction] then begin
   if FTypeData^.MethodKind in [mkFunction, mkClassFunction] then begin
     { skip return type name }
     { skip return type name }
-    ptr := AlignTypeData(PByte(ptr) + ptr^ + SizeOf(Byte));
+    ptr := AlignToPtr(PByte(ptr) + ptr^ + SizeOf(Byte));
     { handle return type }
     { handle return type }
     FReturnType := GRttiPool.GetType(PPPTypeInfo(ptr)^^);
     FReturnType := GRttiPool.GetType(PPPTypeInfo(ptr)^^);
     Inc(ptr, SizeOf(PPTypeInfo));
     Inc(ptr, SizeOf(PPTypeInfo));