File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,10 @@ internal static IntPtr AllocateTypeObject(string name)
454
454
/// </summary>
455
455
internal static void InitializeSlots ( IntPtr type , Type impl )
456
456
{
457
- var seen = new Hashtable ( 8 ) ;
457
+ // We work from the most-derived class up; make sure to get
458
+ // the most-derived slot and not to override it with a base
459
+ // class's slot.
460
+ var seen = new HashSet < string > ( ) ;
458
461
Type offsetType = typeof ( TypeOffset ) ;
459
462
460
463
while ( impl != null )
@@ -473,7 +476,7 @@ internal static void InitializeSlots(IntPtr type, Type impl)
473
476
continue ;
474
477
}
475
478
476
- if ( seen [ name ] != null )
479
+ if ( seen . Contains ( name ) )
477
480
{
478
481
continue ;
479
482
}
@@ -484,7 +487,7 @@ internal static void InitializeSlots(IntPtr type, Type impl)
484
487
IntPtr slot = Interop . GetThunk ( method ) ;
485
488
Marshal . WriteIntPtr ( type , offset , slot ) ;
486
489
487
- seen [ name ] = 1 ;
490
+ seen . Add ( name ) ;
488
491
}
489
492
490
493
impl = impl . BaseType ;
You can’t perform that action at this time.
0 commit comments