浏览代码

* avoid range check error in TVMTBuilder.intf_optimize_vtbls by early bailing out if a class has no interfaces

florian 1 年之前
父节点
当前提交
c3a3cfe80f
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      compiler/nobj.pas

+ 2 - 0
compiler/nobj.pas

@@ -680,6 +680,8 @@ implementation
         cji: boolean;
         cji: boolean;
       begin
       begin
         ImplIntfCount:=_class.ImplementedInterfaces.count;
         ImplIntfCount:=_class.ImplementedInterfaces.count;
+        if ImplIntfCount=0 then
+          exit;
         SetLength(compats,ImplIntfCount);
         SetLength(compats,ImplIntfCount);
         SetLength(aequals,ImplIntfCount);
         SetLength(aequals,ImplIntfCount);
         SetLength(impls,ImplIntfCount);
         SetLength(impls,ImplIntfCount);