ソースを参照

* work arounds the worst of the classtree bugs. LCL now compiles.

git-svn-id: trunk@24275 -
marco 12 年 前
コミット
dfc89a35a7
1 ファイル変更7 行追加4 行削除
  1. 7 4
      utils/fpdoc/fpdocclasstree.pp

+ 7 - 4
utils/fpdoc/fpdocclasstree.pp

@@ -122,7 +122,8 @@ begin
 end;
 
 Function TClassTreeBuilder.AddToClassTree(AElement : TPasElement; ACount : Integer) : TDomElement;
-
+// there are several codepaths that use uninitialized variables. (N,PE)
+// I initialized them to nil to at least make failures deterministic.
 Var
   PC : TPasClassType;
   PE : TDomElement;
@@ -132,7 +133,7 @@ Var
 
 begin
   PF:=StringOfChar(' ',ACount);
-  Result:=Nil;
+  Result:=Nil; N:=Nil;PE:=NIL;
   If (AElement=Nil) then
     begin
     Result:=FTreeStart;
@@ -162,7 +163,7 @@ begin
   If (N<>Nil) then
     Result:=N as TDomElement
   else
-    begin
+    begin // N=NIL, PE might be nil.
     Inc(ACount);
     Result:=FClassTree.CreateElement(AElement.Name);
     If Not (AElement is TPasUnresolvedTypeRef) then
@@ -171,7 +172,9 @@ begin
       if Assigned(M) then
         Result['unit']:=M.Name;
       end;
-    PE.AppendChild(Result);
+      if assigned(PE) then  // if not assigned, probably needs to be
+			    // assigned to something else.
+        PE.AppendChild(Result);
     end;
 end;