Browse Source

* 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 years ago
parent
commit
db66d8f057
1 changed files with 4 additions and 0 deletions
  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(