浏览代码

compiler: remove unneeded check that def is objectdef when we have another check that object has vmt. records don't have vmt so we can leave only one check there

git-svn-id: trunk@16668 -
paul 14 年之前
父节点
当前提交
b7f1ea0a93
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      compiler/ncal.pas

+ 3 - 4
compiler/ncal.pas

@@ -1671,8 +1671,7 @@ implementation
             begin
             begin
               if (procdefinition.typ<>procdef) then
               if (procdefinition.typ<>procdef) then
                 internalerror(200305062);
                 internalerror(200305062);
-              if (tprocdef(procdefinition).struct.typ=objectdef) and
-                 (oo_has_vmt in tprocdef(procdefinition).struct.objectoptions) then
+              if (oo_has_vmt in tprocdef(procdefinition).struct.objectoptions) then
                 begin
                 begin
                   { we only need the vmt, loading self is not required and there is no
                   { we only need the vmt, loading self is not required and there is no
                     need to check for typen, because that will always get the
                     need to check for typen, because that will always get the
@@ -2876,8 +2875,8 @@ implementation
                  assigned(methodpointer) and
                  assigned(methodpointer) and
                  (nf_is_self in methodpointer.flags) then
                  (nf_is_self in methodpointer.flags) then
                 resultdef:=voidtype
                 resultdef:=voidtype
-            else
-              resultdef:=procdefinition.returndef;
+              else
+                resultdef:=procdefinition.returndef;
            end
            end
          else
          else
            resultdef:=typedef;
            resultdef:=typedef;