Browse Source

* Don't generate VMT checking code twice (gen_load_vmt_register generates it already).

git-svn-id: trunk@26657 -
sergei 11 years ago
parent
commit
e0082262cc
1 changed files with 4 additions and 5 deletions
  1. 4 5
      compiler/ncgcal.pas

+ 4 - 5
compiler/ncgcal.pas

@@ -877,13 +877,12 @@ implementation
                      { todo: fix vmt type for high level cg }
                      { todo: fix vmt type for high level cg }
                      hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,proc_addr_voidptrdef,proc_addr_voidptrdef,false);
                      hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,proc_addr_voidptrdef,proc_addr_voidptrdef,false);
                      vmtreg:=methodpointer.location.register;
                      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;
                    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 }
                  { Call through VMT, generate a VTREF symbol to notify the linker }
                  vmtoffset:=tobjectdef(tprocdef(procdefinition).struct).vmtmethodoffset(tprocdef(procdefinition).extnumber);
                  vmtoffset:=tobjectdef(tprocdef(procdefinition).struct).vmtmethodoffset(tprocdef(procdefinition).extnumber);
                  { register call for WPO }
                  { register call for WPO }