소스 검색

* 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(