mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 15:56:08 +02:00
Codetools: prevent endless loop in FindExpressionTypeOfTerm
This commit is contained in:
parent
01a6b1dd5f
commit
caa6e333a2
@ -9798,6 +9798,11 @@ var
|
||||
end;
|
||||
|
||||
procedure ResolvePoint;
|
||||
var
|
||||
CurDesc: TExpressionTypeDesc;
|
||||
CurTool: TFindDeclarationTool;
|
||||
CurNodeDesc: TCodeTreeNodeDesc;
|
||||
CurNodeStart: Integer;
|
||||
begin
|
||||
// for example 'A.B'
|
||||
if fdfExtractOperand in Params.Flags then
|
||||
@ -9808,7 +9813,22 @@ var
|
||||
ReadNextAtom;
|
||||
RaiseIdentExpected(20191003163224);
|
||||
end;
|
||||
CurDesc := ExprType.Desc;
|
||||
CurTool := ExprType.Context.Tool;
|
||||
CurNodeDesc := ExprType.Context.Node.Desc;
|
||||
CurNodeStart := ExprType.Context.Node.StartPos-1;
|
||||
repeat
|
||||
if (CurDesc = ExprType.Desc) and
|
||||
(CurTool = ExprType.Context.Tool) and
|
||||
(CurNodeDesc = ExprType.Context.Node.Desc) and
|
||||
(CurNodeStart = ExprType.Context.Node.StartPos)
|
||||
then
|
||||
break;
|
||||
CurDesc := ExprType.Desc;
|
||||
CurTool := ExprType.Context.Tool;
|
||||
CurNodeDesc := ExprType.Context.Node.Desc;
|
||||
CurNodeStart := ExprType.Context.Node.StartPos;
|
||||
|
||||
ResolveChildren;
|
||||
if ExprType.Desc in xtAllTypeHelperTypes then begin
|
||||
// Lazarus supports record helpers for basic types (string) as well (with TYPEHELPERS modeswitch!).
|
||||
|
Loading…
Reference in New Issue
Block a user