Forráskód Böngészése

* fix from Michalis K. for nesting depth of XMLs (# 11957)

git-svn-id: trunk@11644 -
marco 17 éve
szülő
commit
622ace494e
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      packages/fcl-xml/src/xmlread.pp

+ 2 - 2
packages/fcl-xml/src/xmlread.pp

@@ -2979,9 +2979,9 @@ end;
 
 
 procedure TXMLReader.PushVC(aElDef: TDOMElementDef);
 procedure TXMLReader.PushVC(aElDef: TDOMElementDef);
 begin
 begin
-  if FNesting = Length(FValidator) then
-    SetLength(FValidator, FNesting * 2);
   Inc(FNesting);
   Inc(FNesting);
+  if FNesting >= Length(FValidator) then
+    SetLength(FValidator, FNesting * 2);
   FValidator[FNesting].FElementDef := aElDef;
   FValidator[FNesting].FElementDef := aElDef;
   FValidator[FNesting].FCurCP := nil;
   FValidator[FNesting].FCurCP := nil;
   FValidator[FNesting].FFailed := False;
   FValidator[FNesting].FFailed := False;