From 3ced30f8168409baba430b02bd843f31de329c78 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Mon, 2 Dec 2019 06:59:05 +0000 Subject: [PATCH] * 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 - --- compiler/ncgvmt.pas | 2 -- compiler/nobj.pas | 6 +----- compiler/symdef.pas | 6 +----- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/compiler/ncgvmt.pas b/compiler/ncgvmt.pas index 48fa3a0647..5b60deb05f 100644 --- a/compiler/ncgvmt.pas +++ b/compiler/ncgvmt.pas @@ -966,8 +966,6 @@ implementation hs : string; {$endif vtentry} begin - if not assigned(_class.VMTEntries) then - exit; for i:=0 to _class.VMTEntries.Count-1 do begin vmtentry:=pvmtentry(_class.vmtentries[i]); diff --git a/compiler/nobj.pas b/compiler/nobj.pas index d3db0f1d5a..7abe2e36a3 100644 --- a/compiler/nobj.pas +++ b/compiler/nobj.pas @@ -910,11 +910,7 @@ implementation { inherit (copy) VMT from parent object } 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 keep the same order as that is written in the source diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 6db4205d15..c8ee32a434 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -7331,11 +7331,7 @@ implementation for i:=0 to ImplementedInterfaces.count-1 do tobjectdef(result).ImplementedInterfaces.Add(TImplementedInterface(ImplementedInterfaces[i]).Getcopy); end; - if assigned(vmtentries) then - begin - tobjectdef(result).vmtentries:=TFPList.Create; - tobjectdef(result).copyvmtentries(self); - end; + tobjectdef(result).copyvmtentries(self); end;