Browse Source

* don't replace the vmt entries of unused published virtual methods with
references to FPC_ABSTRACTERROR when using -Owoptvmts, since these can
also be called via rtti

git-svn-id: trunk@13045 -

Jonas Maebe 16 years ago
parent
commit
58f4f7829c
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/optvirt.pas

+ 6 - 1
compiler/optvirt.pas

@@ -1068,8 +1068,13 @@ unit optvirt;
            exit;
          { if it's for a vmtentry of an objdef and the objdef is
            not instantiated, then we can fill the vmt with pointers
-           to FPC_ABSTRACTERROR
+           to FPC_ABSTRACTERROR, except for published methods
+           (these can be called via rtti, so always have to point
+            to the original method)
          }
+         if forvmtentry and
+            (tprocdef(procdef).procsym.visibility=vis_published) then
+           exit;
          if forvmtentry and
             (objdef.typ=objectdef) and
             not classdevirtinfo.instantiated and