From b47c4e74819845d7900a1b0603d137f6a7656a2c Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 25 Apr 2012 16:41:37 +0000 Subject: [PATCH] codetools: fixed uninitialized result git-svn-id: trunk@37022 - --- components/codetools/identcompletiontool.pas | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/codetools/identcompletiontool.pas b/components/codetools/identcompletiontool.pas index ac3e1f1001..bc63b5cf52 100644 --- a/components/codetools/identcompletiontool.pas +++ b/components/codetools/identcompletiontool.pas @@ -812,8 +812,9 @@ var function ProtectedNodeIsInAllowedClass: boolean; var CurClassNode: TCodeTreeNode; - p: TFindContext; + FoundClassContext: TFindContext; begin + Result:=false; if FICTClassAndAncestors<>nil then begin // start of the identifier completion is in a method or class // => all protected ancestor classes are allowed as well. @@ -822,16 +823,14 @@ var and (not (CurClassNode.Desc in AllClasses)) do CurClassNode:=CurClassNode.Parent; if CurClassNode=nil then exit; - p:=CreateFindContext(Params.NewCodeTool,CurClassNode); - if IndexOfFindContext(FICTClassAndAncestors,@p)>=0 then begin + FoundClassContext:=CreateFindContext(Params.NewCodeTool,CurClassNode); + if IndexOfFindContext(FICTClassAndAncestors,@FoundClassContext)>=0 then begin // this class node is the class or one of the ancestors of the class // of the start context of the identifier completion exit(true); end; end; //DebugLn(['ProtectedNodeIsInAllowedClass hidden: ',FindContextToString(FoundContext)]); - - Result:=false; end; function PropertyIsOverridenPublicPublish: boolean;