C#: Fix issue with dispatch to implementations of virtual interface members.

This commit is contained in:
Michael Nebel
2023-03-10 14:45:08 +01:00
parent 278f90e5fa
commit a964f536e8

View File

@@ -497,9 +497,10 @@ private module Internal {
result = c.getAnOverrider(t)
)
or
exists(NonConstructedOverridableCallable c |
exists(NonConstructedOverridableCallable c, NonConstructedOverridableCallable mid |
c = this.getAViableOverrider0() and
result = c.getAnOverrider(_)
c = mid.getUnboundDeclaration() and
result = mid.getAnOverrider(_)
|
this.hasUnconstrainedTypeParameterQualifierType()
or
@@ -1115,8 +1116,7 @@ private module Internal {
/** A call using reflection. */
private class DispatchReflectionCall extends DispatchReflectionOrDynamicCall,
TDispatchReflectionCall
{
TDispatchReflectionCall {
override MethodCall getCall() { this = TDispatchReflectionCall(result, _, _, _, _) }
override string getName() { this = TDispatchReflectionCall(_, result, _, _, _) }
@@ -1164,8 +1164,7 @@ private module Internal {
/** A method call using dynamic types. */
private class DispatchDynamicMethodCall extends DispatchReflectionOrDynamicCall,
TDispatchDynamicMethodCall
{
TDispatchDynamicMethodCall {
override DynamicMethodCall getCall() { this = TDispatchDynamicMethodCall(result) }
override string getName() { result = this.getCall().getLateBoundTargetName() }
@@ -1186,8 +1185,7 @@ private module Internal {
/** An operator call using dynamic types. */
private class DispatchDynamicOperatorCall extends DispatchReflectionOrDynamicCall,
TDispatchDynamicOperatorCall
{
TDispatchDynamicOperatorCall {
override DynamicOperatorCall getCall() { this = TDispatchDynamicOperatorCall(result) }
override string getName() {
@@ -1204,8 +1202,7 @@ private module Internal {
/** A (potential) call to a property accessor using dynamic types. */
private class DispatchDynamicMemberAccess extends DispatchReflectionOrDynamicCall,
TDispatchDynamicMemberAccess
{
TDispatchDynamicMemberAccess {
override DynamicMemberAccess getCall() { this = TDispatchDynamicMemberAccess(result) }
override string getName() {
@@ -1229,8 +1226,7 @@ private module Internal {
/** A (potential) call to an indexer accessor using dynamic types. */
private class DispatchDynamicElementAccess extends DispatchReflectionOrDynamicCall,
TDispatchDynamicElementAccess
{
TDispatchDynamicElementAccess {
override DynamicElementAccess getCall() { this = TDispatchDynamicElementAccess(result) }
override string getName() {
@@ -1256,8 +1252,7 @@ private module Internal {
/** A (potential) call to an event accessor using dynamic types. */
private class DispatchDynamicEventAccess extends DispatchReflectionOrDynamicCall,
TDispatchDynamicEventAccess
{
TDispatchDynamicEventAccess {
override AssignArithmeticOperation getCall() {
this = TDispatchDynamicEventAccess(result, _, _)
}
@@ -1274,8 +1269,7 @@ private module Internal {
/** A call to a constructor using dynamic types. */
private class DispatchDynamicObjectCreation extends DispatchReflectionOrDynamicCall,
TDispatchDynamicObjectCreation
{
TDispatchDynamicObjectCreation {
override DynamicObjectCreation getCall() { this = TDispatchDynamicObjectCreation(result) }
override string getName() { none() }