浏览代码

* ensure that _LookupVtableInfoEx isn't called with a type that needs special handling as we can't (or won't) really cover that using some generic RTTI handling

Sven/Sarah Barth 2 年之前
父节点
当前提交
d77bb5fdd6
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      packages/rtl-generics/src/generics.defaults.pas

+ 4 - 0
packages/rtl-generics/src/generics.defaults.pas

@@ -3382,6 +3382,10 @@ end;
 function _LookupVtableInfoEx(AGInterface: TDefaultGenericInterface; ATypeInfo: PTypeInfo; ASize: SizeInt;
   AFactory: THashFactoryClass): Pointer;
 begin
+  if ATypeInfo^.Kind in TComparerService.UseBinaryMethods then begin
+    System.Error(reInvalidCast);
+    Exit(Nil);
+  end;
   case AGInterface of
     giComparer:
         Exit(