codetools: TStandardCodeTool.FindDanglingComponentEvents; safer align, bug #19109

git-svn-id: trunk@32572 -
This commit is contained in:
mattias 2011-09-30 14:34:13 +00:00
parent 88e2bb396f
commit f18dadf725

View File

@ -4636,7 +4636,8 @@ var
TypeInfo: PTypeInfo;
TypeData: PTypeData;
PropInfo: PPropInfo;
CurCount: integer;
PropList: PPropList;
CurCount,i: integer;
PropType: PTypeInfo;
NodeExt: TCodeTreeNodeExtension;
CurMethod: TMethod;
@ -4652,18 +4653,15 @@ var
repeat
// read all property infos of current class
TypeData:=GetTypeData(TypeInfo);
// skip unit name
PropInfo:=PPropInfo(PByte(@TypeData^.UnitName)+Length(TypeData^.UnitName)+1);
// read property count
CurCount:=PWord(PropInfo)^;
inc(PtrUInt(PropInfo),SizeOf(Word));
CurCount:=GetPropList(TypeInfo,PropList);
try
{$IFDEF VerboseDanglingComponentEvents}
debugln(' UnitName=',TypeData^.UnitName,' Type=',TypeInfo^.Name,' CurPropCount=',dbgs(CurCount));
{$ENDIF}
// read properties
while CurCount>0 do begin
// point PropInfo to next propinfo record.
// Located at Name[Length(Name)+1] !
for i:=0 to CurCount-1 do begin
PropInfo:=PropList^[i];
{$IFDEF VerboseDanglingComponentEvents}
debugln(' Property ',PropInfo^.Name,' Type=',PropInfo^.PropType^.Name);
{$ENDIF}
@ -4704,8 +4702,9 @@ var
CheckMethodsInPersistent(TPersistent(ObjValue));
end;
end;
PropInfo:=PPropInfo(pointer(@PropInfo^.Name)+PByte(@PropInfo^.Name)^+1);
dec(CurCount);
end;
finally
FreeMem(PropList);
end;
TypeInfo:=TypeData^.ParentInfo;
until TypeInfo=nil;