@@ -588,16 +588,19 @@ predicate implementsEquals(ValueOrRefType t) { getInvokedEqualsMethod(t).getDecl
588588 * from the `object.Equals(object)` method inherited by `t`.
589589 */
590590Method getInvokedEqualsMethod ( ValueOrRefType t ) {
591- result = getInheritedEqualsMethod ( t ) and
591+ result = getInheritedEqualsMethod ( t , _ ) and
592592 not exists ( getInvokedIEquatableEqualsMethod ( t , result ) )
593593 or
594594 exists ( EqualsMethod eq |
595595 result = getInvokedIEquatableEqualsMethod ( t , eq ) and
596- getInheritedEqualsMethod ( t ) = eq
596+ getInheritedEqualsMethod ( t , _ ) = eq
597597 )
598598}
599599
600- private EqualsMethod getInheritedEqualsMethod ( ValueOrRefType t ) { t .hasMethod ( result ) }
600+ pragma [ noinline]
601+ private EqualsMethod getInheritedEqualsMethod ( ValueOrRefType t , ValueOrRefType decl ) {
602+ t .hasMethod ( result ) and decl = result .getDeclaringType ( )
603+ }
601604
602605/**
603606 * Equals method `eq` is inherited by `t`, `t` overrides `IEquatable<T>.Equals(T)`
@@ -621,10 +624,9 @@ private EqualsMethod getInheritedEqualsMethod(ValueOrRefType t) { t.hasMethod(re
621624 */
622625private IEquatableEqualsMethod getInvokedIEquatableEqualsMethod ( ValueOrRefType t , EqualsMethod eq ) {
623626 t .hasMethod ( result ) and
624- eq = getInheritedEqualsMethod ( t .getBaseClass ( ) ) and
625627 exists ( IEquatableEqualsMethod ieem |
626628 result = ieem .getAnOverrider * ( ) and
627- eq . getDeclaringType ( ) = ieem .getDeclaringType ( )
629+ eq = getInheritedEqualsMethod ( t . getBaseClass ( ) , ieem .getDeclaringType ( ) )
628630 |
629631 not ieem .fromSource ( )
630632 or
0 commit comments