Explorar el Código

fcl-passrc: fixed free loop

git-svn-id: trunk@39438 -
Mattias Gaertner hace 7 años
padre
commit
c7e07a792c
Se han modificado 2 ficheros con 4 adiciones y 3 borrados
  1. 3 3
      packages/fcl-passrc/src/pastree.pp
  2. 1 0
      packages/fcl-passrc/src/pparser.pp

+ 3 - 3
packages/fcl-passrc/src/pastree.pp

@@ -3833,10 +3833,10 @@ var
 begin
   inherited ForEachCall(aMethodCall, Arg);
   for i:=0 to GenericTemplateTypes.Count-1 do
-    ForEachChildCall(aMethodCall,Arg,TPasElement(GenericTemplateTypes[i]),false);
+    ForEachChildCall(aMethodCall,Arg,TPasElement(GenericTemplateTypes[i]),true);
   for i:=0 to Members.Count-1 do
     ForEachChildCall(aMethodCall,Arg,TPasElement(Members[i]),false);
-  ForEachChildCall(aMethodCall,Arg,VariantEl,false);
+  ForEachChildCall(aMethodCall,Arg,VariantEl,true);
   if Variants<>nil then
     for i:=0 to Variants.Count-1 do
       ForEachChildCall(aMethodCall,Arg,TPasElement(Variants[i]),false);
@@ -4723,7 +4723,7 @@ procedure TPasImplExceptOn.ForEachCall(const aMethodCall: TOnForEachPasElement;
   const Arg: Pointer);
 begin
   ForEachChildCall(aMethodCall,Arg,VarEl,false);
-  ForEachChildCall(aMethodCall,Arg,TypeEl,false);
+  ForEachChildCall(aMethodCall,Arg,TypeEl,true);
   if Elements.IndexOf(Body)<0 then
     ForEachChildCall(aMethodCall,Arg,Body,false);
   inherited ForEachCall(aMethodCall, Arg);

+ 1 - 0
packages/fcl-passrc/src/pparser.pp

@@ -587,6 +587,7 @@ var
     s: String;
   begin
     l := CurPos - Start;
+    s:='';
     SetLength(s, l);
     if l > 0 then
       Move(Start^, s[1], l)