mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 05:19:27 +02:00
Codetools: Prevent a crash in FindIdentififerReference on the name of a program. Issue #40753.
This commit is contained in:
parent
9ad00fb5a7
commit
280ada98b2
@ -6630,7 +6630,7 @@ var
|
|||||||
//debugln(' Found=',dbgs(Found));
|
//debugln(' Found=',dbgs(Found));
|
||||||
Node:=Params.NewNode;
|
Node:=Params.NewNode;
|
||||||
if Found and (Node<>nil) then begin
|
if Found and (Node<>nil) then begin
|
||||||
if ((Node.Desc=ctnUseUnit) or (Node.Parent.Desc=ctnUseUnit))
|
if ((Node.Desc=ctnUseUnit) or ((Node.Parent<>nil) and (Node.Parent.Desc=ctnUseUnit)))
|
||||||
and (Params.NewCodeTool=Self) then begin
|
and (Params.NewCodeTool=Self) then begin
|
||||||
// identifier is a unit reference
|
// identifier is a unit reference
|
||||||
if (DeclarationNode.Desc=ctnSrcName)
|
if (DeclarationNode.Desc=ctnSrcName)
|
||||||
|
Loading…
Reference in New Issue
Block a user