From e0082262cc8d811b1c5ea687b4762efacb25a0cc Mon Sep 17 00:00:00 2001 From: sergei Date: Mon, 3 Feb 2014 00:27:05 +0000 Subject: [PATCH] * Don't generate VMT checking code twice (gen_load_vmt_register generates it already). git-svn-id: trunk@26657 - --- compiler/ncgcal.pas | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index 489f6c59fb..046ceaee9f 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -877,13 +877,12 @@ implementation { todo: fix vmt type for high level cg } hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,proc_addr_voidptrdef,proc_addr_voidptrdef,false); vmtreg:=methodpointer.location.register; + { test validity of VMT } + if not(is_interface(tprocdef(procdefinition).struct)) and + not(is_cppclass(tprocdef(procdefinition).struct)) then + cg.g_maybe_testvmt(current_asmdata.CurrAsmList,vmtreg,tobjectdef(tprocdef(procdefinition).struct)); end; - { test validity of VMT } - if not(is_interface(tprocdef(procdefinition).struct)) and - not(is_cppclass(tprocdef(procdefinition).struct)) then - cg.g_maybe_testvmt(current_asmdata.CurrAsmList,vmtreg,tobjectdef(tprocdef(procdefinition).struct)); - { Call through VMT, generate a VTREF symbol to notify the linker } vmtoffset:=tobjectdef(tprocdef(procdefinition).struct).vmtmethodoffset(tprocdef(procdefinition).extnumber); { register call for WPO }