Browse Source

* apply (adjusted) patch by Blaise.ru: vmtentries is always created since 2008, so treat it as such (also fixes a memory leak in tobjectdef.getcopy)

git-svn-id: trunk@43626 -
svenbarth 5 years ago
parent
commit
3ced30f816
3 changed files with 2 additions and 12 deletions
  1. 0 2
      compiler/ncgvmt.pas
  2. 1 5
      compiler/nobj.pas
  3. 1 5
      compiler/symdef.pas

+ 0 - 2
compiler/ncgvmt.pas

@@ -966,8 +966,6 @@ implementation
          hs : string;
          hs : string;
 {$endif vtentry}
 {$endif vtentry}
       begin
       begin
-        if not assigned(_class.VMTEntries) then
-          exit;
         for i:=0 to _class.VMTEntries.Count-1 do
         for i:=0 to _class.VMTEntries.Count-1 do
          begin
          begin
            vmtentry:=pvmtentry(_class.vmtentries[i]);
            vmtentry:=pvmtentry(_class.vmtentries[i]);

+ 1 - 5
compiler/nobj.pas

@@ -910,11 +910,7 @@ implementation
 
 
         { inherit (copy) VMT from parent object }
         { inherit (copy) VMT from parent object }
         if assigned(_class.childof) then
         if assigned(_class.childof) then
-          begin
-            if not assigned(_class.childof.vmtentries) then
-              internalerror(200810281);
-            _class.copyvmtentries(_class.childof);
-          end;
+          _class.copyvmtentries(_class.childof);
 
 
         { process all procdefs, we must process the defs to
         { process all procdefs, we must process the defs to
           keep the same order as that is written in the source
           keep the same order as that is written in the source

+ 1 - 5
compiler/symdef.pas

@@ -7331,11 +7331,7 @@ implementation
             for i:=0 to ImplementedInterfaces.count-1 do
             for i:=0 to ImplementedInterfaces.count-1 do
               tobjectdef(result).ImplementedInterfaces.Add(TImplementedInterface(ImplementedInterfaces[i]).Getcopy);
               tobjectdef(result).ImplementedInterfaces.Add(TImplementedInterface(ImplementedInterfaces[i]).Getcopy);
           end;
           end;
-        if assigned(vmtentries) then
-          begin
-            tobjectdef(result).vmtentries:=TFPList.Create;
-            tobjectdef(result).copyvmtentries(self);
-          end;
+        tobjectdef(result).copyvmtentries(self);
       end;
       end;