merge r51138 #d8163c8187,r51139,r51140 codetools:

* prevent AV for incomplete generic types
* fix TDirectiveSequenceItem.FindValue
* pascalreadertool: support TGenericClass<TypeReference,TypeReference>.TNestedClass (delphi mode)

git-svn-id: branches/fixes_1_6@51226 -
This commit is contained in:
ondrej 2016-01-08 11:52:30 +00:00
parent e0a4752636
commit faea94b4b2
3 changed files with 9 additions and 1 deletions

View File

@ -7032,6 +7032,8 @@ begin
end else if Node.Desc<>ctnTypeDefinition then
exit;
Node:=Node.FirstChild;
if Node=nil then
Exit;
Identifier:=@Src[Node.StartPos];
if (Node=nil)
or (not (Node.Desc in AllClasses))

View File

@ -1045,7 +1045,7 @@ function TDirectiveSequenceItem.FindValue(const ACleanPos: integer; out
I, Max, Min: Integer;
ResIndex, ResCleanPos: integer;
begin
Max := High(FItems);
Max := FLastItem;
Min := 0;
ResIndex := -1;
ResCleanPos := -1;

View File

@ -4101,6 +4101,7 @@ procedure TPascalParserTool.ReadTypeReference;
TButton
controls.TButton
TGenericClass<TypeReference,TypeReference>
TGenericClass<TypeReference,TypeReference>.TNestedClass
}
var SavePos: TAtomPosition;
begin
@ -4122,6 +4123,11 @@ begin
CurNode.LastChild := nil;
ReadSpecialize(True);
CurNode.EndPos := CurPos.EndPos;
while CurPos.Flag=cafPoint do begin
ReadNextAtom;
AtomIsIdentifierSaveE;
ReadNextAtom;
end;
end;
procedure TPascalParserTool.ReadClassInterfaceContent;