codetools: fixed crash if Result not in function

git-svn-id: trunk@48414 -
This commit is contained in:
mattias 2015-03-18 17:13:09 +00:00
parent 9ece157c2a
commit c292a5e843

View File

@ -7339,7 +7339,7 @@ var
// -> check if in a function
if fdfExtractOperand in Params.Flags then Params.AddOperandPart('Result');
ProcNode:=StartNode;
while not NodeIsFunction(ProcNode) do
while (ProcNode<>nil) and not NodeIsFunction(ProcNode) do
ProcNode:=ProcNode.Parent;
if (ProcNode<>nil) then begin
if IsEnd and (fdfFindVariable in StartFlags) then begin