From 3346c3b5c2aea16ba1d00a326351fd06fb3de8cb Mon Sep 17 00:00:00 2001 From: Sven/Sarah Barth Date: Tue, 28 Mar 2023 23:13:34 +0200 Subject: [PATCH] * 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 (cherry picked from commit db66d8f0570c3b4ccae736879067d6960feb0342) --- packages/rtl-generics/src/generics.defaults.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/rtl-generics/src/generics.defaults.pas b/packages/rtl-generics/src/generics.defaults.pas index 93870bcce8..aafce9a3e2 100644 --- a/packages/rtl-generics/src/generics.defaults.pas +++ b/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(